mirror of
https://github.com/mdlayher/homelab.git
synced 2024-12-14 11:47:32 +00:00
*: apply tags to all playbooks, cleanup
This commit is contained in:
parent
b32fd2156f
commit
cd3244020a
5 changed files with 75 additions and 5 deletions
|
@ -1,20 +1,32 @@
|
|||
---
|
||||
- name: install git
|
||||
tags:
|
||||
- golang
|
||||
apt: pkg=git state=installed
|
||||
|
||||
- name: install mercurial
|
||||
tags:
|
||||
- golang
|
||||
apt: pkg=mercurial state=installed
|
||||
|
||||
- name: remove any existing go installations
|
||||
tags:
|
||||
- golang
|
||||
file: path={{ golang_root }} state=absent
|
||||
|
||||
- name: download and checksum go tarball
|
||||
tags:
|
||||
- golang
|
||||
get_url: url={{ golang_url }} dest={{ golang_tgz }} checksum=sha256:{{ golang_sha256 }}
|
||||
|
||||
- name: unpack tarball
|
||||
tags:
|
||||
- golang
|
||||
unarchive: src={{ golang_tgz }} dest=/usr/local/ copy=no
|
||||
|
||||
- name: insert go configuration into shell configuration
|
||||
tags:
|
||||
- golang
|
||||
blockinfile:
|
||||
dest: /{{ golang_user }}/.bashrc
|
||||
marker: "# {mark} ansible-managed Go configuration"
|
||||
|
@ -25,10 +37,16 @@
|
|||
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
|
||||
|
||||
- name: create personal GOPATH location
|
||||
tags:
|
||||
- golang
|
||||
file: path={{ golang_home_dir }}/src/{{ golang_personal_gopath }} state=directory
|
||||
|
||||
- name: symlink personal GOPATH location to ~/go
|
||||
tags:
|
||||
- golang
|
||||
file: dest={{ golang_home_dir }}/go src={{ golang_home_dir }}/src/{{ golang_personal_gopath }} owner={{ golang_user }} group={{ golang_user }} state=link
|
||||
|
||||
- name: remove temporary go tarball
|
||||
tags:
|
||||
- golang
|
||||
file: path={{ golang_tgz }} state=absent
|
||||
|
|
|
@ -1,12 +1,20 @@
|
|||
---
|
||||
- name: add packagecloud apt key
|
||||
tags:
|
||||
- grafana
|
||||
apt_key: url=https://packagecloud.io/gpg.key state=present
|
||||
|
||||
- name: add grafana apt repository
|
||||
tags:
|
||||
- grafana
|
||||
apt_repository: repo="deb https://packagecloud.io/grafana/stable/debian/ wheezy main" state=present
|
||||
|
||||
- name: install grafana
|
||||
tags:
|
||||
- grafana
|
||||
apt: pkg=grafana state=installed update_cache=yes
|
||||
|
||||
- name: start grafana service
|
||||
tags:
|
||||
- grafana
|
||||
service: name=grafana-server state=started enabled=yes
|
||||
|
|
|
@ -1,12 +1,20 @@
|
|||
---
|
||||
- name: download and checksum plex debian package
|
||||
tags:
|
||||
- plex
|
||||
get_url: url={{ plex_url }} dest={{ plex_deb }} checksum=sha1:{{ plex_sha1 }}
|
||||
|
||||
- name: install plex
|
||||
tags:
|
||||
- plex
|
||||
apt: deb={{ plex_deb }} state=installed
|
||||
|
||||
- name: remove temporary plex debian package
|
||||
tags:
|
||||
- plex
|
||||
file: path={{ plex_deb }} state=absent
|
||||
|
||||
- name: start plex service
|
||||
tags:
|
||||
- plex
|
||||
service: name=plexmediaserver state=started enabled=yes
|
||||
|
|
|
@ -1,45 +1,73 @@
|
|||
---
|
||||
- name: check if prometheus service exists
|
||||
tags:
|
||||
- prometheus
|
||||
stat: path=/etc/init/prometheus.conf
|
||||
register: prometheusexists
|
||||
|
||||
- name: stop prometheus service
|
||||
tags:
|
||||
- prometheus
|
||||
service: name=prometheus state=stopped
|
||||
when: prometheusexists.stat.exists
|
||||
|
||||
- name: download and checksum prometheus tarball
|
||||
tags:
|
||||
- prometheus
|
||||
get_url: url={{ prometheus_url }} dest={{ prometheus_tgz }} checksum=sha1:{{ prometheus_sha1 }}
|
||||
|
||||
- name: unpack tarball
|
||||
- name: unpack prometheus tarball
|
||||
tags:
|
||||
- prometheus
|
||||
unarchive: src={{ prometheus_tgz }} dest=/tmp/ copy=no
|
||||
|
||||
- name: create prometheus user
|
||||
tags:
|
||||
- prometheus
|
||||
user: name=prometheus shell=/bin/false comment="prometheus service user"
|
||||
|
||||
- name: copy prometheus binary to /usr/local/bin
|
||||
tags:
|
||||
- prometheus
|
||||
copy: src={{ prometheus_tmp }}/prometheus dest=/usr/local/bin/ owner=prometheus group=prometheus mode=0755
|
||||
|
||||
- name: copy promtool binary to /usr/local/bin
|
||||
tags:
|
||||
- prometheus
|
||||
copy: src={{ prometheus_tmp }}/promtool dest=/usr/local/bin/ owner=prometheus group=prometheus mode=0755
|
||||
|
||||
- name: create prometheus config directory
|
||||
tags:
|
||||
- prometheus
|
||||
file: path={{ prometheus_config }} state=directory owner=prometheus group=prometheus mode=0755
|
||||
|
||||
- name: create prometheus configuration
|
||||
tags:
|
||||
- prometheus
|
||||
template: src=prometheus.yml.j2 dest={{ prometheus_config }}/prometheus.yml
|
||||
with_items: "{{ prometheus_jobs }}"
|
||||
|
||||
- name: create prometheus data directory
|
||||
tags:
|
||||
- prometheus
|
||||
file: path={{ prometheus_data }} state=directory owner=prometheus group=prometheus mode=0755
|
||||
|
||||
- name: create prometheus upstart job
|
||||
tags:
|
||||
- prometheus
|
||||
template: src=prometheus.conf.j2 dest=/etc/init/prometheus.conf
|
||||
|
||||
- name: start prometheus service
|
||||
tags:
|
||||
- prometheus
|
||||
service: name=prometheus state=started enabled=yes
|
||||
|
||||
- name: remove temporary prometheus directory
|
||||
tags:
|
||||
- prometheus
|
||||
file: path={{ prometheus_tmp }} state=absent
|
||||
|
||||
- name: remove temporary prometheus tarball
|
||||
tags:
|
||||
- prometheus
|
||||
file: path={{ prometheus_tgz }} state=absent
|
||||
|
|
|
@ -1,23 +1,31 @@
|
|||
---
|
||||
- name: install rtorrent
|
||||
tags:
|
||||
- rtorrent
|
||||
apt: pkg=rtorrent state=installed
|
||||
register: rtorrentinstalled
|
||||
|
||||
- name: fail the play if rtorrent could not be installed
|
||||
when: rtorrentinstalled|failed
|
||||
fail: msg="failed to install rtorrent"
|
||||
|
||||
- name: create rtorrent user
|
||||
tags:
|
||||
- rtorrent
|
||||
user: name=rtorrent shell=/bin/false comment="rtorrent service user"
|
||||
|
||||
- name: create rtorrent configuration
|
||||
tags:
|
||||
- rtorrent
|
||||
template: src=rtorrent.rc.j2 dest=/home/rtorrent/.rtorrent.rc owner=rtorrent group=rtorrent mode=0755
|
||||
|
||||
- name: create files directory
|
||||
tags:
|
||||
- rtorrent
|
||||
file: path={{ rtorrent_path_files }} state=directory owner=rtorrent group=rtorrent mode=0755
|
||||
|
||||
- name: create watch directory
|
||||
tags:
|
||||
- rtorrent
|
||||
file: path={{ rtorrent_path_watch }} state=directory owner=rtorrent group=rtorrent mode=0755
|
||||
|
||||
- name: create session directory
|
||||
tags:
|
||||
- rtorrent
|
||||
file: path={{ rtorrent_path_session }} state=directory owner=rtorrent group=rtorrent mode=0755
|
||||
|
|
Loading…
Reference in a new issue