|
@@ -0,0 +1,58 @@
|
|
|
+---
|
|
|
+- name: Setup hosts
|
|
|
+ hosts: localhost
|
|
|
+ gather_facts: no
|
|
|
+ user: root
|
|
|
+ tasks:
|
|
|
+ - name: build inven
|
|
|
+ add_host: "name={{ hostvars[item]['ec2_public_dns_name'] }} groups=oo_hosts"
|
|
|
+ with_items: groups['tag_env-host-type_kwoodsontest2-openshift-node']
|
|
|
+
|
|
|
+ - debug: msg=oo_hosts
|
|
|
+
|
|
|
+- name: Deploy host-monitoring
|
|
|
+ hosts: oo_hosts
|
|
|
+ user: root
|
|
|
+ tasks:
|
|
|
+ - name: Deploy docker oso-f22-host-monitoring
|
|
|
+ command: docker pull docker-registry.ops.rhcloud.com/ops/oso-f22-host-monitoring
|
|
|
+
|
|
|
+ - name: Deploy oso-rhel7-zagg-client
|
|
|
+ command: docker pull docker-registry.ops.rhcloud.com/ops/oso-rhel7-zagg-client
|
|
|
+
|
|
|
+ - name: Copy oso-f22-host-monitoring systemd file
|
|
|
+ copy:
|
|
|
+ src: oso-f22-host-monitoring.service
|
|
|
+ dest: /etc/systemd/system/oso-f22-host-monitoring.service
|
|
|
+ owner: root
|
|
|
+ group: root
|
|
|
+ mode: 0644
|
|
|
+ register: pcp_systemd
|
|
|
+
|
|
|
+ - name: Copy zagg-client systemd file
|
|
|
+ copy:
|
|
|
+ src: oso-rhel7-zagg-client.service
|
|
|
+ dest: /etc/systemd/system/oso-rhel7-zagg-client.service
|
|
|
+ owner: root
|
|
|
+ group: root
|
|
|
+ mode: 0644
|
|
|
+ register: zagg_systemd
|
|
|
+
|
|
|
+ - name: reload systemd
|
|
|
+ command: /usr/bin/systemctl --system daemon-reload
|
|
|
+ when: pcp_systemd.changed or zagg_systemd.changed
|
|
|
+
|
|
|
+ - name: pasue for a few seconds
|
|
|
+ pause: seconds=5
|
|
|
+
|
|
|
+ - name: Start the oso-f22-host-monitoring service
|
|
|
+ service:
|
|
|
+ name: oso-f22-host-monitoring
|
|
|
+ state: started
|
|
|
+ enabled: yes
|
|
|
+
|
|
|
+ - name: Start the oso-rhel7-zagg-client service
|
|
|
+ service:
|
|
|
+ name: oso-rhel7-zagg-client
|
|
|
+ state: started
|
|
|
+ enabled: yes
|