From 7f60edeba48d78cd01669d20019e9bdacdf4e305 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Fri, 2 Jun 2017 14:06:52 +0200 Subject: Move the openstack provisioning playbooks They'll live in playbooks/provisioning/openstack from now on. --- .../openstack/post-provision-openstack.yml | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 playbooks/provisioning/openstack/post-provision-openstack.yml (limited to 'playbooks/provisioning/openstack/post-provision-openstack.yml') diff --git a/playbooks/provisioning/openstack/post-provision-openstack.yml b/playbooks/provisioning/openstack/post-provision-openstack.yml new file mode 100644 index 000000000..d65e075b8 --- /dev/null +++ b/playbooks/provisioning/openstack/post-provision-openstack.yml @@ -0,0 +1,60 @@ +--- + +# Assign hostnames +- hosts: cluster_hosts + pre_tasks: + - include: roles/common/pre_tasks/pre_tasks.yml + roles: + - role: hostnames + +# Subscribe DNS Host to allow for configuration below +- hosts: dns + roles: + - { role: subscription-manager, when: hostvars.localhost.rhsm_register, tags: 'subscription-manager', ansible_sudo: true } + +# Determine which DNS server(s) to use for our generated records +- hosts: localhost + roles: + - dns-server-detect + +# Build the DNS Server Views and Configure DNS Server(s) +- hosts: dns + pre_tasks: + - include: roles/common/pre_tasks/pre_tasks.yml + - name: "Generate dns-server views" + include: openstack_dns_views.yml + roles: + - role: dns-server + +# Build and process DNS Records +- hosts: localhost + pre_tasks: + - include: roles/common/pre_tasks/pre_tasks.yml + - name: "Generate dns records" + include: openstack_dns_records.yml + roles: + - role: dns + +# Use newly configured DNS server for this container ... +- hosts: localhost + tasks: + - name: "Edit /etc/resolv.conf in container" + shell: "sed '0,/.*nameserver.*/s/.*nameserver.*/nameserver {{ public_dns_server }} \\n&/' /etc/resolv.conf > /tmp/resolv.conf && /bin/cp -f /tmp/resolv.conf /etc/resolv.conf" + +# OpenShift Pre-Requisites +- hosts: OSEv3 + tasks: + - name: "Edit /etc/resolv.conf on masters/nodes" + lineinfile: + state: present + dest: /etc/resolv.conf + regexp: "nameserver {{ hostvars['localhost'].private_dns_server }}" + line: "nameserver {{ hostvars['localhost'].private_dns_server }}" + insertafter: search* + - name: "Include DNS configuration to ensure proper name resolution" + lineinfile: + state: present + dest: /etc/sysconfig/network + regexp: "IP4_NAMESERVERS={{ hostvars['localhost'].private_dns_server }}" + line: "IP4_NAMESERVERS={{ hostvars['localhost'].private_dns_server }}" + -- cgit v1.2.3 From 0858a645a4ec808d0309b8522f55cef23792fce9 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Fri, 2 Jun 2017 14:43:13 +0200 Subject: Fix privileges in the pre-install playbook --- .../openstack/post-provision-openstack.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'playbooks/provisioning/openstack/post-provision-openstack.yml') diff --git a/playbooks/provisioning/openstack/post-provision-openstack.yml b/playbooks/provisioning/openstack/post-provision-openstack.yml index d65e075b8..e1faf14eb 100644 --- a/playbooks/provisioning/openstack/post-provision-openstack.yml +++ b/playbooks/provisioning/openstack/post-provision-openstack.yml @@ -2,25 +2,30 @@ # Assign hostnames - hosts: cluster_hosts + become: true pre_tasks: - - include: roles/common/pre_tasks/pre_tasks.yml + - include: pre_tasks.yml roles: - role: hostnames # Subscribe DNS Host to allow for configuration below - hosts: dns + become: true roles: - - { role: subscription-manager, when: hostvars.localhost.rhsm_register, tags: 'subscription-manager', ansible_sudo: true } + - role: subscription-manager + when: hostvars.localhost.rhsm_register + tags: 'subscription-manager' # Determine which DNS server(s) to use for our generated records - hosts: localhost - roles: + roles: - dns-server-detect # Build the DNS Server Views and Configure DNS Server(s) - hosts: dns + become: true pre_tasks: - - include: roles/common/pre_tasks/pre_tasks.yml + - include: pre_tasks.yml - name: "Generate dns-server views" include: openstack_dns_views.yml roles: @@ -29,20 +34,15 @@ # Build and process DNS Records - hosts: localhost pre_tasks: - - include: roles/common/pre_tasks/pre_tasks.yml + - include: pre_tasks.yml - name: "Generate dns records" include: openstack_dns_records.yml roles: - role: dns -# Use newly configured DNS server for this container ... -- hosts: localhost - tasks: - - name: "Edit /etc/resolv.conf in container" - shell: "sed '0,/.*nameserver.*/s/.*nameserver.*/nameserver {{ public_dns_server }} \\n&/' /etc/resolv.conf > /tmp/resolv.conf && /bin/cp -f /tmp/resolv.conf /etc/resolv.conf" - # OpenShift Pre-Requisites - hosts: OSEv3 + become: true tasks: - name: "Edit /etc/resolv.conf on masters/nodes" lineinfile: -- cgit v1.2.3 From bf7e5e82872684088995cc55559f8e51fe35d4a9 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Fri, 16 Jun 2017 17:52:37 +0200 Subject: Fix yamllint errors --- playbooks/provisioning/openstack/post-provision-openstack.yml | 2 -- 1 file changed, 2 deletions(-) (limited to 'playbooks/provisioning/openstack/post-provision-openstack.yml') diff --git a/playbooks/provisioning/openstack/post-provision-openstack.yml b/playbooks/provisioning/openstack/post-provision-openstack.yml index e1faf14eb..4e42c1c7f 100644 --- a/playbooks/provisioning/openstack/post-provision-openstack.yml +++ b/playbooks/provisioning/openstack/post-provision-openstack.yml @@ -1,5 +1,4 @@ --- - # Assign hostnames - hosts: cluster_hosts become: true @@ -57,4 +56,3 @@ dest: /etc/sysconfig/network regexp: "IP4_NAMESERVERS={{ hostvars['localhost'].private_dns_server }}" line: "IP4_NAMESERVERS={{ hostvars['localhost'].private_dns_server }}" - -- cgit v1.2.3