summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks')
-rw-r--r--playbooks/adhoc/atomic_openshift_tutorial_reset.yml93
-rw-r--r--playbooks/adhoc/create_pv/create_pv.yaml17
-rw-r--r--playbooks/adhoc/zabbix_setup/create_user.yml31
-rw-r--r--playbooks/aws/openshift-cluster/config.yml2
-rw-r--r--playbooks/aws/openshift-cluster/tasks/launch_instances.yml13
-rw-r--r--playbooks/byo/openshift-cluster/config.yml2
-rw-r--r--playbooks/common/openshift-master/config.yml2
-rw-r--r--playbooks/gce/openshift-cluster/config.yml2
-rw-r--r--playbooks/libvirt/openshift-cluster/config.yml2
-rw-r--r--playbooks/libvirt/openshift-cluster/launch.yml8
-rw-r--r--playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml5
-rw-r--r--playbooks/openstack/openshift-cluster/config.yml2
12 files changed, 172 insertions, 7 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) }}"
diff --git a/playbooks/aws/openshift-cluster/config.yml b/playbooks/aws/openshift-cluster/config.yml
index 8106d5da9..a8e3e27bb 100644
--- a/playbooks/aws/openshift-cluster/config.yml
+++ b/playbooks/aws/openshift-cluster/config.yml
@@ -17,7 +17,7 @@
g_sudo: "{{ hostvars.localhost.g_sudo_tmp }}"
g_nodeonmaster: true
openshift_cluster_id: "{{ cluster_id }}"
- openshift_debug_level: 4
+ openshift_debug_level: 2
openshift_deployment_type: "{{ deployment_type }}"
openshift_hostname: "{{ ec2_private_ip_address }}"
openshift_public_hostname: "{{ ec2_ip_address }}"
diff --git a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml
index 236d84e74..e9ebc3e02 100644
--- a/playbooks/aws/openshift-cluster/tasks/launch_instances.yml
+++ b/playbooks/aws/openshift-cluster/tasks/launch_instances.yml
@@ -147,6 +147,18 @@
tag_host-type_{{ host_type }}, tag_env-host-type_{{ env_host_type }},
tag_sub-host-type_{{ sub_host_type }}"
+- set_fact:
+ node_label:
+ region: "{{ec2_region}}"
+ type: "{{sub_host_type}}"
+ when: host_type == "node"
+
+- set_fact:
+ node_label:
+ region: "{{ec2_region}}"
+ type: "{{host_type}}"
+ when: host_type != "node"
+
- name: Add new instances groups and variables
add_host:
hostname: "{{ item.0 }}"
@@ -156,6 +168,7 @@
groups: "{{ instance_groups }}"
ec2_private_ip_address: "{{ item.1.private_ip }}"
ec2_ip_address: "{{ item.1.public_ip }}"
+ openshift_node_labels: "{{ node_label }}"
with_together:
- instances
- ec2.instances
diff --git a/playbooks/byo/openshift-cluster/config.yml b/playbooks/byo/openshift-cluster/config.yml
index 2ee1d50a7..9e50a4a18 100644
--- a/playbooks/byo/openshift-cluster/config.yml
+++ b/playbooks/byo/openshift-cluster/config.yml
@@ -5,5 +5,5 @@
g_masters_group: "{{ 'masters' }}"
g_nodes_group: "{{ 'nodes' }}"
openshift_cluster_id: "{{ cluster_id | default('default') }}"
- openshift_debug_level: 4
+ openshift_debug_level: 2
openshift_deployment_type: "{{ deployment_type }}"
diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml
index 904ad2dab..acf85fc04 100644
--- a/playbooks/common/openshift-master/config.yml
+++ b/playbooks/common/openshift-master/config.yml
@@ -215,6 +215,8 @@
- role: openshift_master_cluster
when: openshift_master_ha | bool
- openshift_examples
+ - role: openshift_cluster_metrics
+ when: openshift.common.use_cluster_metrics | bool
# Additional instance config for online deployments
- name: Additional instance config
diff --git a/playbooks/gce/openshift-cluster/config.yml b/playbooks/gce/openshift-cluster/config.yml
index 219ebe6a0..fd5dfcc72 100644
--- a/playbooks/gce/openshift-cluster/config.yml
+++ b/playbooks/gce/openshift-cluster/config.yml
@@ -19,6 +19,6 @@
g_ssh_user: "{{ hostvars.localhost.g_ssh_user_tmp }}"
g_sudo: "{{ hostvars.localhost.g_sudo_tmp }}"
openshift_cluster_id: "{{ cluster_id }}"
- openshift_debug_level: 4
+ openshift_debug_level: 2
openshift_deployment_type: "{{ deployment_type }}"
openshift_hostname: "{{ gce_private_ip }}"
diff --git a/playbooks/libvirt/openshift-cluster/config.yml b/playbooks/libvirt/openshift-cluster/config.yml
index 98fe11251..c208eee81 100644
--- a/playbooks/libvirt/openshift-cluster/config.yml
+++ b/playbooks/libvirt/openshift-cluster/config.yml
@@ -20,5 +20,5 @@
g_ssh_user: "{{ hostvars.localhost.g_ssh_user_tmp }}"
g_sudo: "{{ hostvars.localhost.g_sudo_tmp }}"
openshift_cluster_id: "{{ cluster_id }}"
- openshift_debug_level: 4
+ openshift_debug_level: 2
openshift_deployment_type: "{{ deployment_type }}"
diff --git a/playbooks/libvirt/openshift-cluster/launch.yml b/playbooks/libvirt/openshift-cluster/launch.yml
index 830f9d216..d3e768de5 100644
--- a/playbooks/libvirt/openshift-cluster/launch.yml
+++ b/playbooks/libvirt/openshift-cluster/launch.yml
@@ -17,6 +17,14 @@
- include: tasks/configure_libvirt.yml
+ - include: ../../common/openshift-cluster/set_etcd_launch_facts_tasks.yml
+ - include: tasks/launch_instances.yml
+ vars:
+ instances: "{{ etcd_names }}"
+ cluster: "{{ cluster_id }}"
+ type: "{{ k8s_type }}"
+ g_sub_host_type: "default"
+
- include: ../../common/openshift-cluster/set_master_launch_facts_tasks.yml
- include: tasks/launch_instances.yml
vars:
diff --git a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml
index 4cb494056..2a0c90b46 100644
--- a/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml
+++ b/playbooks/libvirt/openshift-cluster/tasks/launch_instances.yml
@@ -63,8 +63,9 @@
shell: 'virsh -c {{ libvirt_uri }} net-dhcp-leases openshift-ansible | egrep -c ''{{ instances | join("|") }}'''
register: nb_allocated_ips
until: nb_allocated_ips.stdout == '{{ instances | length }}'
- retries: 30
+ retries: 60
delay: 1
+ when: instances | length != 0
- name: Collect IP addresses of the VMs
shell: 'virsh -c {{ libvirt_uri }} net-dhcp-leases openshift-ansible | awk ''$6 == "{{ item }}" {gsub(/\/.*/, "", $5); print $5}'''
@@ -72,7 +73,7 @@
with_items: instances
- set_fact:
- ips: "{{ scratch_ip.results | oo_collect('stdout') }}"
+ ips: "{{ scratch_ip.results | default([]) | oo_collect('stdout') }}"
- name: Add new instances
add_host:
diff --git a/playbooks/openstack/openshift-cluster/config.yml b/playbooks/openstack/openshift-cluster/config.yml
index 3c9a231e3..a5ee2d6a5 100644
--- a/playbooks/openstack/openshift-cluster/config.yml
+++ b/playbooks/openstack/openshift-cluster/config.yml
@@ -15,6 +15,6 @@
g_ssh_user: "{{ hostvars.localhost.g_ssh_user_tmp }}"
g_sudo: "{{ hostvars.localhost.g_sudo_tmp }}"
openshift_cluster_id: "{{ cluster_id }}"
- openshift_debug_level: 4
+ openshift_debug_level: 2
openshift_deployment_type: "{{ deployment_type }}"
openshift_hostname: "{{ ansible_default_ipv4.address }}"