summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicky Elrod <codeblock@fedoraproject.org>2015-11-10 20:11:11 +0000
committerRicky Elrod <codeblock@fedoraproject.org>2015-11-10 20:11:11 +0000
commitedc4b7067d6ab7dd5f2f2eaa038a953f24f83ce9 (patch)
tree679c753eca7b5da99248cd890e58a02cef41b880
parent25e3829da9765572f27662db0fb48ac955019b77 (diff)
downloadansible-edc4b7067d6ab7dd5f2f2eaa038a953f24f83ce9.zip
ansible-edc4b7067d6ab7dd5f2f2eaa038a953f24f83ce9.tar.gz
ansible-edc4b7067d6ab7dd5f2f2eaa038a953f24f83ce9.tar.xz
watchdog-ify staging, hopefully
Signed-off-by: Ricky Elrod <codeblock@fedoraproject.org>
-rw-r--r--inventory/group_vars/staging9
-rw-r--r--inventory/host_vars/fedocal01.stg.phx2.fedoraproject.org9
-rw-r--r--playbooks/groups/fedocal.yml1
-rw-r--r--roles/base/files/watchdog.conf3
-rw-r--r--roles/base/handlers/main.yml (renamed from roles/watchdog/handlers/main.yml)0
-rw-r--r--roles/base/tasks/main.yml43
-rw-r--r--roles/watchdog/files/watchdog-device1
-rw-r--r--roles/watchdog/tasks/main.yml28
8 files changed, 55 insertions, 39 deletions
diff --git a/inventory/group_vars/staging b/inventory/group_vars/staging
index cd9c3a2..f083e2b 100644
--- a/inventory/group_vars/staging
+++ b/inventory/group_vars/staging
@@ -12,3 +12,12 @@ collectd_graphite: True
fedmsg_prefix: org.fedoraproject
fedmsg_env: stg
+
+virt_install_command: virt-install -n {{ inventory_hostname }} -r {{ mem_size }}
+ --disk bus=virtio,path={{ volgroup }}/{{ inventory_hostname }}
+ --vcpus={{ num_cpus }} -l {{ ks_repo }} -x
+ 'ksdevice=eth0 ks={{ ks_url }} console=tty0 console=ttyS0
+ hostname={{ inventory_hostname }} nameserver={{ dns }}
+ ip={{ eth0_ip }}::{{ gw }}:{{ nm }}:{{ inventory_hostname }}:eth0:none'
+ --network bridge=br0,model=virtio
+ --autostart --noautoconsole --watchdog default
diff --git a/inventory/host_vars/fedocal01.stg.phx2.fedoraproject.org b/inventory/host_vars/fedocal01.stg.phx2.fedoraproject.org
index 24942d3..601b0af 100644
--- a/inventory/host_vars/fedocal01.stg.phx2.fedoraproject.org
+++ b/inventory/host_vars/fedocal01.stg.phx2.fedoraproject.org
@@ -10,12 +10,3 @@ volgroup: /dev/vg_guests
eth0_ip: 10.5.126.66
vmhost: virthost11.phx2.fedoraproject.org
datacenter: phx2
-
-virt_install_command: virt-install -n {{ inventory_hostname }} -r {{ mem_size }}
- --disk bus=virtio,path={{ volgroup }}/{{ inventory_hostname }}
- --vcpus={{ num_cpus }} -l {{ ks_repo }} -x
- 'ksdevice=eth0 ks={{ ks_url }} console=tty0 console=ttyS0
- hostname={{ inventory_hostname }} nameserver={{ dns }}
- ip={{ eth0_ip }}::{{ gw }}:{{ nm }}:{{ inventory_hostname }}:eth0:none'
- --network bridge=br0,model=virtio
- --autostart --noautoconsole --watchdog default
diff --git a/playbooks/groups/fedocal.yml b/playbooks/groups/fedocal.yml
index 1f9f25c..7d9a060 100644
--- a/playbooks/groups/fedocal.yml
+++ b/playbooks/groups/fedocal.yml
@@ -12,7 +12,6 @@
roles:
- base
- - { role: watchdog, when: env == "staging" }
- rkhunter
- { role: denyhosts, when: ansible_distribution_major_version|int != 7 }
- nagios_client
diff --git a/roles/base/files/watchdog.conf b/roles/base/files/watchdog.conf
new file mode 100644
index 0000000..92254d8
--- /dev/null
+++ b/roles/base/files/watchdog.conf
@@ -0,0 +1,3 @@
+watchdog-device = /dev/watchdog
+realtime = yes
+priority = 1
diff --git a/roles/watchdog/handlers/main.yml b/roles/base/handlers/main.yml
index 76965db..76965db 100644
--- a/roles/watchdog/handlers/main.yml
+++ b/roles/base/handlers/main.yml
diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml
index a490509..d52053d 100644
--- a/roles/base/tasks/main.yml
+++ b/roles/base/tasks/main.yml
@@ -346,3 +346,46 @@
tags:
- config
- base
+
+#
+# Watchdog stuff
+#
+- name: install watchdog
+ yum: pkg={{ item }} state=present
+ with_items:
+ - watchdog
+ tags:
+ - packages
+ - watchdog
+ - base
+ when: ansible_distribution_major_version|int < 22 && env == 'staging'
+
+- name: install watchdog
+ dnf: pkg={{ item }} state=present
+ with_items:
+ - watchdog
+ tags:
+ - packages
+ - watchdog
+ - base
+ when: ansible_distribution_major_version|int > 21 && env == 'staging'
+
+- name: watchdog device configuration
+ copy: src=watchdog.conf dest=/etc/watchdog.conf owner=root group=root mode=644
+ when: env == 'staging'
+ tags:
+ - config
+ - watchdog
+ - base
+ notify: restart watchdog
+
+- name: Set watchdog to run on boot
+ service: name=watchdog enabled=yes
+ when: env == 'staging'
+ ignore_errors: true
+ notify:
+ - restart watchdog
+ tags:
+ - service
+ - watchdog
+ - base
diff --git a/roles/watchdog/files/watchdog-device b/roles/watchdog/files/watchdog-device
deleted file mode 100644
index c18f97a..0000000
--- a/roles/watchdog/files/watchdog-device
+++ /dev/null
@@ -1 +0,0 @@
-watchdog-device=/dev/watchdog
diff --git a/roles/watchdog/tasks/main.yml b/roles/watchdog/tasks/main.yml
deleted file mode 100644
index 1bea4ff..0000000
--- a/roles/watchdog/tasks/main.yml
+++ /dev/null
@@ -1,28 +0,0 @@
----
-#
-# Setup watchdog
-#
-- name: install needed packages
- yum: pkg={{ item }} state=present
- with_items:
- - watchdog
- tags:
- - packages
- - watchdog
- when: ansible_distribution_major_version|int < 22
-
-- name: install needed packages
- dnf: pkg={{ item }} state=present
- with_items:
- - watchdog
- tags:
- - packages
- - watchdog
- when: ansible_distribution_major_version|int > 21
-
-- name: watchdog device configuration
- copy: src=watchdog-device dest=/etc/watchdog.d/watchdog-device owner=root group=root mode=644
- tags:
- - config
- - watchdog
- notify: restart watchdog