diff options
author | Diego Castro <spinolacastro@gmail.com> | 2015-08-22 18:10:17 -0300 |
---|---|---|
committer | Diego Castro <spinolacastro@gmail.com> | 2015-08-22 18:10:17 -0300 |
commit | 055921cd545c12733949f37c1af2c0a1296216ec (patch) | |
tree | 0ad645b9a75eacbb168c9fdc92d585867b5317a4 /playbooks/adhoc | |
parent | 10b8c46d02d1ec9f4edf3df4b60e3bf533e73533 (diff) | |
parent | 922b87ede66f6b7e376d1f46e13327077cd41719 (diff) | |
download | openshift-055921cd545c12733949f37c1af2c0a1296216ec.tar.gz openshift-055921cd545c12733949f37c1af2c0a1296216ec.tar.bz2 openshift-055921cd545c12733949f37c1af2c0a1296216ec.tar.xz openshift-055921cd545c12733949f37c1af2c0a1296216ec.zip |
Merge remote-tracking branch 'openshift/master'
Diffstat (limited to 'playbooks/adhoc')
-rw-r--r-- | playbooks/adhoc/atomic_openshift_tutorial_reset.yml | 93 | ||||
-rw-r--r-- | playbooks/adhoc/create_pv/create_pv.yaml | 17 | ||||
-rw-r--r-- | playbooks/adhoc/zabbix_setup/create_user.yml | 31 |
3 files changed, 141 insertions, 0 deletions
diff --git a/playbooks/adhoc/atomic_openshift_tutorial_reset.yml b/playbooks/adhoc/atomic_openshift_tutorial_reset.yml new file mode 100644 index 000000000..1200caa2a --- /dev/null +++ b/playbooks/adhoc/atomic_openshift_tutorial_reset.yml @@ -0,0 +1,93 @@ +# This deletes *ALL* Docker images, and uninstalls OpenShift and +# Atomic Enterprise RPMs. It is primarily intended for use +# with the tutorial as well as for developers to reset state. + +- hosts: + - OSEv3:children + + sudo: yes + + tasks: + - service: name={{ item }} state=stopped + with_items: + - openvswitch + - origin-master + - origin-node + - atomic-openshift-master + - atomic-openshift-node + - openshift-master + - openshift-node + - atomic-enterprise-master + - atomic-enterprise-node + + - yum: name={{ item }} state=absent + with_items: + - openvswitch + - origin + - origin-master + - origin-node + - origin-sdn-ovs + - tuned-profiles-origin-node + - atomic-openshift + - atomic-openshift-master + - atomic-openshift-node + - atomic-openshift-sdn-ovs + - tuned-profiles-atomic-openshift-node + - atomic-enterprise + - atomic-enterprise-master + - atomic-enterprise-node + - atomic-enterprise-sdn-ovs + - tuned-profiles-atomic-enterprise-node + - openshift + - openshift-master + - openshift-node + - openshift-sdn-ovs + - tuned-profiles-openshift-node + + - shell: systemctl reset-failed + changed_when: False + + - shell: systemctl daemon-reload + changed_when: False + + - shell: find /var/lib/origin/openshift.local.volumes -type d -exec umount {} \; 2>/dev/null || true + changed_when: False + + - shell: find /var/lib/atomic-enterprise/openshift.local.volumes -type d -exec umount {} \; 2>/dev/null || true + changed_when: False + + - shell: find /var/lib/openshift/openshift.local.volumes -type d -exec umount {} \; 2>/dev/null || true + changed_when: False + + - shell: docker ps -a -q | xargs docker stop + changed_when: False + + - shell: docker ps -a -q| xargs docker rm + changed_when: False + + - shell: docker images -q |xargs docker rmi + changed_when: False + + - file: path={{ item }} state=absent + with_items: + - /etc/openshift-sdn + - /root/.kube + - /etc/origin + - /etc/atomic-enterprise + - /etc/openshift + - /var/lib/origin + - /var/lib/openshift + - /var/lib/atomic-enterprise + - /etc/sysconfig/origin-master + - /etc/sysconfig/origin-node + - /etc/sysconfig/atomic-openshift-master + - /etc/sysconfig/atomic-openshift-node + - /etc/sysconfig/openshift-master + - /etc/sysconfig/openshift-node + - /etc/sysconfig/atomic-enterprise-master + - /etc/sysconfig/atomic-enterprise-node + + - user: name={{ item }} state=absent remove=yes + with_items: + - alice + - joe diff --git a/playbooks/adhoc/create_pv/create_pv.yaml b/playbooks/adhoc/create_pv/create_pv.yaml index 684a0ca72..4f0ef7a75 100644 --- a/playbooks/adhoc/create_pv/create_pv.yaml +++ b/playbooks/adhoc/create_pv/create_pv.yaml @@ -50,6 +50,16 @@ - debug: var=vol + - name: tag the vol with a name + ec2_tag: region={{ hostvars[oo_name]['ec2_region'] }} resource={{vol.volume_id}} + args: + tags: + Name: "pv-{{ hostvars[oo_name]['ec2_tag_Name'] }}" + env: "{{cli_environment}}" + register: voltags + + - debug: var=voltags + - name: Configure the drive gather_facts: no hosts: oo_master @@ -118,6 +128,13 @@ state: unmounted fstype: ext4 + - name: remove from fstab + mount: + name: "{{ pv_mntdir }}" + src: "{{ cli_device_name }}" + state: absent + fstype: ext4 + - name: detach drive delegate_to: localhost ec2_vol: diff --git a/playbooks/adhoc/zabbix_setup/create_user.yml b/playbooks/adhoc/zabbix_setup/create_user.yml new file mode 100644 index 000000000..dd74798b7 --- /dev/null +++ b/playbooks/adhoc/zabbix_setup/create_user.yml @@ -0,0 +1,31 @@ +--- +# export PYTHONPATH='/usr/lib/python2.7/site-packages/:/home/kwoodson/git/openshift-tools' +# ansible-playbook -e 'cli_password=zabbix' -e 'cli_new_password=new-zabbix' create_user.yml +- hosts: localhost + gather_facts: no + vars_files: + - vars/template_heartbeat.yml + - vars/template_os_linux.yml + vars: + g_zserver: http://localhost/zabbix/api_jsonrpc.php + g_zuser: admin + g_zpassword: "{{ cli_password }}" + roles: + - ../../../roles/os_zabbix + post_tasks: + - zbx_user: + server: "{{ g_zserver }}" + user: "{{ g_zuser }}" + password: "{{ g_zpassword }}" + state: list + register: users + + - debug: var=users + + - name: Update zabbix creds for admin + zbx_user: + server: "{{ g_zserver }}" + user: "{{ g_zuser }}" + password: "{{ g_zpassword }}" + alias: Admin + passwd: "{{ cli_new_password | default(g_zpassword, true) }}" |