Merge "Decouple OpenShiftGlusterDisks from openshift-master.yaml"
This commit is contained in:
commit
e0139adfda
@ -82,3 +82,59 @@ outputs:
|
|||||||
with_items: {get_attr: [RoleParametersValue, value, OpenShiftGlusterDisks]}
|
with_items: {get_attr: [RoleParametersValue, value, OpenShiftGlusterDisks]}
|
||||||
upgrade_tasks: []
|
upgrade_tasks: []
|
||||||
step_config: ''
|
step_config: ''
|
||||||
|
external_deploy_tasks:
|
||||||
|
- name: openshift_cns step 1 Generate Inventory
|
||||||
|
when: step == '1'
|
||||||
|
block:
|
||||||
|
- name: create openshift temp dirs
|
||||||
|
file:
|
||||||
|
path: "{{item}}"
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- "{{playbook_dir}}/openshift/inventory"
|
||||||
|
|
||||||
|
- name: set openshift global vars fact
|
||||||
|
set_fact:
|
||||||
|
openshift_gluster_disks: {get_attr: [RoleParametersValue, value, OpenShiftGlusterDisks]}
|
||||||
|
|
||||||
|
- name: generate openshift inventory for openshift_glusterfs service
|
||||||
|
lineinfile:
|
||||||
|
path: "{{playbook_dir}}/openshift/inventory/openshift_glusterfs.ini"
|
||||||
|
create: true
|
||||||
|
line: "[openshift_glusterfs:children]"
|
||||||
|
insertbefore: BOF
|
||||||
|
|
||||||
|
- name: generate openshift inventory for openshift_glusterfs service
|
||||||
|
lineinfile:
|
||||||
|
path: "{{playbook_dir}}/openshift/inventory/openshift_glusterfs.ini"
|
||||||
|
insertafter: "[openshift_glusterfs:children]"
|
||||||
|
line:
|
||||||
|
str_replace:
|
||||||
|
template: ROLENAME
|
||||||
|
params:
|
||||||
|
ROLENAME: {get_param: RoleName}
|
||||||
|
|
||||||
|
- name: generate openshift inventory for Role
|
||||||
|
copy:
|
||||||
|
dest:
|
||||||
|
str_replace:
|
||||||
|
template: "{{playbook_dir}}/openshift/inventory/ROLENAME_openshift_glusterfs.yml"
|
||||||
|
params:
|
||||||
|
ROLENAME: {get_param: RoleName}
|
||||||
|
content:
|
||||||
|
str_replace:
|
||||||
|
params:
|
||||||
|
ROLENAME: {get_param: RoleName}
|
||||||
|
template: |
|
||||||
|
glusterfs:
|
||||||
|
hosts:
|
||||||
|
{% for host in groups['ROLENAME'] | default([]) -%}
|
||||||
|
{{ hostvars.raw_get(host)['ansible_hostname'] }}:
|
||||||
|
glusterfs_ip: {{hostvars.raw_get(host)['storage_ip']}}
|
||||||
|
glusterfs_devices:
|
||||||
|
{{openshift_gluster_disks | to_nice_yaml() | indent(8) }}
|
||||||
|
ansible_user: {{ hostvars.raw_get(host)['ansible_user'] | default(hostvars.raw_get(host)['ansible_ssh_user']) | default('root') }}
|
||||||
|
ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }}
|
||||||
|
ansible_become: true
|
||||||
|
openshift_schedulable: true
|
||||||
|
{% endfor %}
|
||||||
|
@ -48,28 +48,6 @@ parameters:
|
|||||||
default: {}
|
default: {}
|
||||||
description: OpenShift node vars specific for the worker nodes
|
description: OpenShift node vars specific for the worker nodes
|
||||||
type: json
|
type: json
|
||||||
OpenShiftGlusterDisks:
|
|
||||||
default:
|
|
||||||
- /dev/vdb
|
|
||||||
- /dev/vdc
|
|
||||||
- /dev/vdd
|
|
||||||
description: List of disks for openshift_glusterfs service to use
|
|
||||||
type: comma_delimited_list
|
|
||||||
tags:
|
|
||||||
- role_specific
|
|
||||||
|
|
||||||
resources:
|
|
||||||
RoleParametersValue:
|
|
||||||
type: OS::Heat::Value
|
|
||||||
properties:
|
|
||||||
type: json
|
|
||||||
value:
|
|
||||||
map_replace:
|
|
||||||
- map_replace:
|
|
||||||
- OpenShiftGlusterDisks: OpenShiftGlusterDisks
|
|
||||||
- values: {get_param: [RoleParameters]}
|
|
||||||
- values:
|
|
||||||
OpenShiftGlusterDisks: {get_param: OpenShiftGlusterDisks}
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
role_data:
|
role_data:
|
||||||
@ -97,83 +75,53 @@ outputs:
|
|||||||
path: "{{item}}"
|
path: "{{item}}"
|
||||||
state: directory
|
state: directory
|
||||||
with_items:
|
with_items:
|
||||||
- "{{playbook_dir}}/openshift"
|
- "{{playbook_dir}}/openshift/inventory"
|
||||||
|
|
||||||
- name: set openshift global vars fact
|
- name: set openshift global vars fact
|
||||||
set_fact:
|
set_fact:
|
||||||
openshift_global_vars: {get_param: OpenShiftGlobalVariables}
|
openshift_global_vars: {get_param: OpenShiftGlobalVariables}
|
||||||
openshift_master_node_vars: {get_param: OpenShiftMasterNodeVars}
|
openshift_master_node_vars: {get_param: OpenShiftMasterNodeVars}
|
||||||
openshift_worker_node_vars: {get_param: OpenShiftWorkerNodeVars}
|
openshift_worker_node_vars: {get_param: OpenShiftWorkerNodeVars}
|
||||||
openshift_gluster_disks: {get_attr: [RoleParametersValue, value, OpenShiftGlusterDisks]}
|
|
||||||
|
|
||||||
- name: generate openshift inventory
|
- name: generate openshift inventory for openshift_master service
|
||||||
copy:
|
copy:
|
||||||
dest: "{{playbook_dir}}/openshift/inventory.yml"
|
dest:
|
||||||
content: |
|
str_replace:
|
||||||
masters:
|
template: "{{playbook_dir}}/openshift/inventory/ROLENAME_openshift_master.yml"
|
||||||
hosts:
|
params:
|
||||||
{% for host in groups['openshift_master'] -%}
|
ROLENAME: {get_param: RoleName}
|
||||||
{{ hostvars.raw_get(host)['ansible_hostname'] }}:
|
content:
|
||||||
ansible_user: {{ hostvars.raw_get(host)['ansible_user'] | default(hostvars.raw_get(host)['ansible_ssh_user']) | default('root') }}
|
str_replace:
|
||||||
ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }}
|
params:
|
||||||
ansible_become: true
|
ROLENAME: {get_param: RoleName}
|
||||||
etcd_ip: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
template: |
|
||||||
openshift_ip: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
masters:
|
||||||
openshift_public_ip: {{hostvars.raw_get(host)['external_ip'] | default(hostvars.raw_get(host)['ctlplane_ip'])}}
|
hosts:
|
||||||
openshift_hostname: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
{% for host in groups['ROLENAME'] -%}
|
||||||
openshift_public_hostname: {{hostvars.raw_get(host)['external_ip'] | default(hostvars.raw_get(host)['ctlplane_ip'])}}
|
{{ hostvars.raw_get(host)['ansible_hostname'] }}:
|
||||||
{% if openshift_master_node_vars -%}
|
ansible_user: {{ hostvars.raw_get(host)['ansible_user'] | default(hostvars.raw_get(host)['ansible_ssh_user']) | default('root') }}
|
||||||
{{openshift_master_node_vars | to_nice_yaml() | indent(6)}}
|
ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }}
|
||||||
{%- endif %}
|
ansible_become: true
|
||||||
|
etcd_ip: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
||||||
|
openshift_ip: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
||||||
|
openshift_public_ip: {{hostvars.raw_get(host)['external_ip'] | default(hostvars.raw_get(host)['ctlplane_ip'])}}
|
||||||
|
openshift_hostname: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
||||||
|
openshift_public_hostname: {{hostvars.raw_get(host)['external_ip'] | default(hostvars.raw_get(host)['ctlplane_ip'])}}
|
||||||
|
{% if openshift_master_node_vars -%}
|
||||||
|
{{openshift_master_node_vars | to_nice_yaml() | indent(6)}}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
nodes:
|
etcd:
|
||||||
hosts:
|
children:
|
||||||
{% for host in groups['openshift_worker'] -%}
|
masters: {}
|
||||||
{{ hostvars.raw_get(host)['ansible_hostname'] }}:
|
|
||||||
ansible_user: {{ hostvars.raw_get(host)['ansible_user'] | default(hostvars.raw_get(host)['ansible_ssh_user']) | default('root') }}
|
|
||||||
ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }}
|
|
||||||
ansible_become: true
|
|
||||||
etcd_ip: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
|
||||||
openshift_ip: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
|
||||||
openshift_public_ip: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
|
||||||
openshift_hostname: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
|
||||||
openshift_public_hostname: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
|
||||||
openshift_schedulable: true
|
|
||||||
openshift_node_labels:
|
|
||||||
region: 'infra'
|
|
||||||
zone: 'default'
|
|
||||||
{% if openshift_worker_node_vars -%}
|
|
||||||
{{openshift_worker_node_vars | to_nice_yaml() | indent(6)}}
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{% endfor %}
|
OSEv3:
|
||||||
|
children:
|
||||||
{% if groups['openshift_glusterfs'] | default([]) %}
|
masters: {}
|
||||||
glusterfs:
|
nodes: {}
|
||||||
hosts:
|
{% if groups['openshift_glusterfs'] | default([]) %}glusterfs: {}{% endif %}
|
||||||
{% for host in groups['openshift_glusterfs'] | default([]) -%}
|
|
||||||
{{ hostvars.raw_get(host)['ansible_hostname'] }}:
|
|
||||||
glusterfs_ip: {{hostvars.raw_get(host)['storage_ip']}}
|
|
||||||
glusterfs_devices:
|
|
||||||
{{openshift_gluster_disks | to_nice_yaml() | indent(8) }}
|
|
||||||
ansible_user: {{ hostvars.raw_get(host)['ansible_user'] | default(hostvars.raw_get(host)['ansible_ssh_user']) | default('root') }}
|
|
||||||
ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }}
|
|
||||||
ansible_become: true
|
|
||||||
openshift_schedulable: true
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
etcd:
|
|
||||||
children:
|
|
||||||
masters: {}
|
|
||||||
|
|
||||||
OSEv3:
|
|
||||||
children:
|
|
||||||
masters: {}
|
|
||||||
nodes: {}
|
|
||||||
{% if groups['openshift_glusterfs'] | default([]) %}glusterfs: {}{% endif %}
|
|
||||||
|
|
||||||
- name: generate openshift global defaults
|
- name: generate openshift global defaults
|
||||||
copy:
|
copy:
|
||||||
@ -248,7 +196,7 @@ outputs:
|
|||||||
{%- else -%}
|
{%- else -%}
|
||||||
ANSIBLE_HOST_KEY_CHECKING=False
|
ANSIBLE_HOST_KEY_CHECKING=False
|
||||||
ansible-playbook
|
ansible-playbook
|
||||||
-i '{{playbook_dir}}/openshift/inventory.yml'
|
-i '{{playbook_dir}}/openshift/inventory'
|
||||||
--extra-vars '@{{playbook_dir}}/openshift/global_defaults.yml'
|
--extra-vars '@{{playbook_dir}}/openshift/global_defaults.yml'
|
||||||
--extra-vars '@{{playbook_dir}}/openshift/global_vars.yml'
|
--extra-vars '@{{playbook_dir}}/openshift/global_vars.yml'
|
||||||
'{{playbook_dir}}/openshift/playbook.yml'
|
'{{playbook_dir}}/openshift/playbook.yml'
|
||||||
|
@ -52,3 +52,43 @@ outputs:
|
|||||||
dport: '30000-32767'
|
dport: '30000-32767'
|
||||||
upgrade_tasks: []
|
upgrade_tasks: []
|
||||||
step_config: ''
|
step_config: ''
|
||||||
|
external_deploy_tasks:
|
||||||
|
- name: openshift_worker step 1
|
||||||
|
when: step == '1'
|
||||||
|
block:
|
||||||
|
- name: create openshift temp dirs
|
||||||
|
file:
|
||||||
|
path: "{{item}}"
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- "{{playbook_dir}}/openshift/inventory"
|
||||||
|
|
||||||
|
- name: generate openshift inventory for openshift_worker service
|
||||||
|
copy:
|
||||||
|
dest:
|
||||||
|
str_replace:
|
||||||
|
template: "{{playbook_dir}}/openshift/inventory/ROLENAME_openshift_worker.yml"
|
||||||
|
params:
|
||||||
|
ROLENAME: {get_param: RoleName}
|
||||||
|
content:
|
||||||
|
str_replace:
|
||||||
|
params:
|
||||||
|
ROLENAME: {get_param: RoleName}
|
||||||
|
template: |
|
||||||
|
nodes:
|
||||||
|
hosts:
|
||||||
|
{% for host in groups['ROLENAME'] -%}
|
||||||
|
{{ hostvars.raw_get(host)['ansible_hostname'] }}:
|
||||||
|
ansible_user: {{ hostvars.raw_get(host)['ansible_user'] | default(hostvars.raw_get(host)['ansible_ssh_user']) | default('root') }}
|
||||||
|
ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }}
|
||||||
|
ansible_become: true
|
||||||
|
etcd_ip: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
||||||
|
openshift_ip: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
||||||
|
openshift_public_ip: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
||||||
|
openshift_hostname: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
||||||
|
openshift_public_hostname: {{hostvars.raw_get(host)['ctlplane_ip']}}
|
||||||
|
openshift_schedulable: true
|
||||||
|
openshift_node_labels:
|
||||||
|
region: 'infra'
|
||||||
|
zone: 'default'
|
||||||
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user