summaryrefslogtreecommitdiffstats
path: root/playbooks/openstack
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/openstack')
-rw-r--r--playbooks/openstack/openshift-cluster/config.yml33
l---------playbooks/openstack/openshift-cluster/lookup_plugins1
-rw-r--r--playbooks/openstack/openshift-cluster/update.yml4
-rw-r--r--playbooks/openstack/openshift-cluster/vars.yml43
4 files changed, 39 insertions, 42 deletions
diff --git a/playbooks/openstack/openshift-cluster/config.yml b/playbooks/openstack/openshift-cluster/config.yml
index abadaf5ca..3c9a231e3 100644
--- a/playbooks/openstack/openshift-cluster/config.yml
+++ b/playbooks/openstack/openshift-cluster/config.yml
@@ -1,35 +1,20 @@
-- name: Populate oo_masters_to_config host group
- hosts: localhost
+- hosts: localhost
gather_facts: no
vars_files:
- vars.yml
tasks:
- - name: Evaluate oo_masters_to_config
- add_host:
- name: "{{ item }}"
- ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
- ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
- groups: oo_masters_to_config
- with_items: groups["tag_env-host-type_{{ cluster_id }}-openshift-master"] | default([])
- - name: Evaluate oo_nodes_to_config
- add_host:
- name: "{{ item }}"
- ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
- ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
- groups: oo_nodes_to_config
- with_items: groups["tag_env-host-type_{{ cluster_id }}-openshift-node"] | default([])
- - name: Evaluate oo_first_master
- add_host:
- name: "{{ groups['tag_env-host-type_' ~ cluster_id ~ '-openshift-master'][0] }}"
- ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
- ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
- groups: oo_first_master
- when: "'tag_env-host-type_{{ cluster_id }}-openshift-master' in groups"
+ - set_fact:
+ g_ssh_user_tmp: "{{ deployment_vars[deployment_type].ssh_user }}"
+ g_sudo_tmp: "{{ deployment_vars[deployment_type].sudo }}"
- include: ../../common/openshift-cluster/config.yml
vars:
+ g_etcd_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-etcd' }}"
+ g_masters_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-master' }}"
+ g_nodes_group: "{{ 'tag_env-host-type_' ~ cluster_id ~ '-openshift-node' }}"
+ 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_deployment_type: "{{ deployment_type }}"
- openshift_first_master: "{{ groups.oo_first_master.0 }}"
openshift_hostname: "{{ ansible_default_ipv4.address }}"
diff --git a/playbooks/openstack/openshift-cluster/lookup_plugins b/playbooks/openstack/openshift-cluster/lookup_plugins
new file mode 120000
index 000000000..ac79701db
--- /dev/null
+++ b/playbooks/openstack/openshift-cluster/lookup_plugins
@@ -0,0 +1 @@
+../../../lookup_plugins \ No newline at end of file
diff --git a/playbooks/openstack/openshift-cluster/update.yml b/playbooks/openstack/openshift-cluster/update.yml
index 5e7ab4e58..e006aa74a 100644
--- a/playbooks/openstack/openshift-cluster/update.yml
+++ b/playbooks/openstack/openshift-cluster/update.yml
@@ -11,7 +11,9 @@
groups: oo_hosts_to_update
ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
- with_items: groups["tag_env-host-type_{{ cluster_id }}-openshift-master"] | union(groups["tag_env-host-type_{{ cluster_id }}-openshift-node"]) | default([])
+ with_items: (groups["tag_env-host-type_{{ cluster_id }}-openshift-master"] | default([]))
+ | union(groups["tag_env-host-type_{{ cluster_id }}-openshift-node"] | default([]))
+ | union(groups["tag_env-host-type_{{ cluster_id }}-openshift-etcd"] | default([]))
- include: ../../common/openshift-cluster/update_repos_and_packages.yml
diff --git a/playbooks/openstack/openshift-cluster/vars.yml b/playbooks/openstack/openshift-cluster/vars.yml
index c754f19fc..1ae7c17d2 100644
--- a/playbooks/openstack/openshift-cluster/vars.yml
+++ b/playbooks/openstack/openshift-cluster/vars.yml
@@ -1,27 +1,36 @@
---
-openstack_infra_heat_stack: "{{ opt_infra_heat_stack | default('files/heat_stack.yml') }}"
-openstack_network_prefix: "{{ opt_network_prefix | default('openshift-ansible-'+cluster_id) }}"
-openstack_network_cidr: "{{ opt_net_cidr | default('192.168.' + ( ( 1048576 | random % 256 ) | string() ) + '.0/24') }}"
-openstack_network_external_net: "{{ opt_external_net | default('external') }}"
-openstack_floating_ip_pools: "{{ opt_floating_ip_pools | default('external') | oo_split() }}"
-openstack_network_dns: "{{ opt_dns | default('8.8.8.8,8.8.4.4') | oo_split() }}"
-openstack_ssh_keypair: "{{ opt_keypair | default(lookup('env', 'LOGNAME')+'_key') }}"
-openstack_ssh_public_key: "{{ lookup('file', opt_public_key | default('~/.ssh/id_rsa.pub')) }}"
-openstack_ssh_access_from: "{{ opt_ssh_from | default('0.0.0.0/0') }}"
+openstack_infra_heat_stack: "{{ lookup('oo_option', 'infra_heat_stack' ) |
+ default('files/heat_stack.yml', True) }}"
+openstack_network_prefix: "{{ lookup('oo_option', 'network_prefix' ) |
+ default('openshift-ansible-'+cluster_id, True) }}"
+openstack_network_cidr: "{{ lookup('oo_option', 'net_cidr' ) |
+ default('192.168.' + ( ( 1048576 | random % 256 ) | string() ) + '.0/24', True) }}"
+openstack_network_external_net: "{{ lookup('oo_option', 'external_net' ) |
+ default('external', True) }}"
+openstack_floating_ip_pools: "{{ lookup('oo_option', 'floating_ip_pools') |
+ default('external', True) | oo_split() }}"
+openstack_network_dns: "{{ lookup('oo_option', 'dns' ) |
+ default('8.8.8.8,8.8.4.4', True) | oo_split() }}"
+openstack_ssh_keypair: "{{ lookup('oo_option', 'keypair' ) |
+ default(lookup('env', 'LOGNAME')+'_key', True) }}"
+openstack_ssh_public_key: "{{ lookup('file', lookup('oo_option', 'public_key') |
+ default('~/.ssh/id_rsa.pub', True)) }}"
+openstack_ssh_access_from: "{{ lookup('oo_option', 'ssh_from') |
+ default('0.0.0.0/0', True) }}"
openstack_flavor:
master:
- ram: "{{ opt_master_flavor_ram | default(2048) }}"
- id: "{{ opt_master_flavor_id | default() }}"
- include: "{{ opt_master_flavor_include | default() }}"
+ ram: "{{ lookup('oo_option', 'master_flavor_ram' ) | default(2048, True) }}"
+ id: "{{ lookup('oo_option', 'master_flavor_id' ) | default(True) }}"
+ include: "{{ lookup('oo_option', 'master_flavor_include') | default(True) }}"
node:
- ram: "{{ opt_node_flavor_ram | default(4096) }}"
- id: "{{ opt_node_flavor_id | default() }}"
- include: "{{ opt_node_flavor_include | default() }}"
+ ram: "{{ lookup('oo_option', 'node_flavor_ram' ) | default(4096, True) }}"
+ id: "{{ lookup('oo_option', 'node_flavor_id' ) | default(True) }}"
+ include: "{{ lookup('oo_option', 'node_flavor_include' ) | default(True) }}"
deployment_vars:
origin:
image:
- name: "{{ opt_image_name | default('centos-70-raw') }}"
+ name: "{{ lookup('oo_option', 'image_name') | default('centos-70-raw', True) }}"
id:
ssh_user: openshift
sudo: yes
@@ -33,7 +42,7 @@ deployment_vars:
sudo: no
enterprise:
image:
- name: "{{ opt_image_name | default('centos-70-raw') }}"
+ name: "{{ lookup('oo_option', 'image_name') | default('rhel-guest-image-7.1-20150224.0.x86_64', True) }}"
id:
ssh_user: openshift
sudo: yes