Merge "Remove Newton specific upgrade playbooks"
This commit is contained in:
commit
5a76f0c163
@ -69,18 +69,6 @@ Before starting with the new version, you should do pre-flight checks
|
|||||||
to ensure everything is fine. If any of those check fail, the upgrade
|
to ensure everything is fine. If any of those check fail, the upgrade
|
||||||
should stop to let the deployer chose what to do.
|
should stop to let the deployer chose what to do.
|
||||||
|
|
||||||
Making sure LBaaS v1 isn't in the way
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
Because LBaaS was deprecated, this playbook checks if it was previously
|
|
||||||
deployed, and fails if this is the case.
|
|
||||||
|
|
||||||
See :ref:`lbaas-version-check` for more details.
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
# openstack-ansible "${UPGRADE_PLAYBOOKS}/lbaas-version-check.yml"
|
|
||||||
|
|
||||||
Cleanup old facts
|
Cleanup old facts
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -118,26 +106,6 @@ See :ref:`user-secrets-playbook` for more details.
|
|||||||
|
|
||||||
# openstack-ansible "${UPGRADE_PLAYBOOKS}/user-secrets-adjustment.yml"
|
# openstack-ansible "${UPGRADE_PLAYBOOKS}/user-secrets-adjustment.yml"
|
||||||
|
|
||||||
Cleanup old MariaDB apt repositories
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
The default MariaDB apt repositories have been changed to use HTTP instead of
|
|
||||||
HTTPS. This playbook removes existing repositories of the previous default.
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
# openstack-ansible "${UPGRADE_PLAYBOOKS}/mariadb-apt-cleanup.yml"
|
|
||||||
|
|
||||||
Update database collations
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
The default database collation has been changed to `utf8_general_ci`. This play
|
|
||||||
performs a conversion on existing databases and tables.
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
# openstack-ansible "${UPGRADE_PLAYBOOKS}/db-collation-alter.yml"
|
|
||||||
|
|
||||||
Cleanup pip.conf file
|
Cleanup pip.conf file
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -210,17 +178,6 @@ the |current_release_formal_name| release.
|
|||||||
|
|
||||||
# openstack-ansible repo-install.yml
|
# openstack-ansible repo-install.yml
|
||||||
|
|
||||||
Ensure hostname aliases are created for non-RFC1034/35 hostnames
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
Ensure an alias is created for non-RFC1034/35 hostnames.
|
|
||||||
|
|
||||||
See :ref:`old-hostname-compatibility` for details.
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
# openstack-ansible "${UPGRADE_PLAYBOOKS}/old-hostname-compatibility.yml"
|
|
||||||
|
|
||||||
Perform a mariadb version upgrade
|
Perform a mariadb version upgrade
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@ -262,15 +219,6 @@ See :ref:`memcached-flush` for details.
|
|||||||
|
|
||||||
# openstack-ansible "${UPGRADE_PLAYBOOKS}/memcached-flush.yml"
|
# openstack-ansible "${UPGRADE_PLAYBOOKS}/memcached-flush.yml"
|
||||||
|
|
||||||
Stop and remove ``aodh-api`` service
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
See :ref:`aodh-api-init-delete` for details.
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
# openstack-ansible "${UPGRADE_PLAYBOOKS}/aodh-api-init-delete.yml"
|
|
||||||
|
|
||||||
Upgrade OpenStack
|
Upgrade OpenStack
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -9,20 +9,6 @@ Within the main :file:`scripts` directory there is an :file:`upgrade-utilities`
|
|||||||
directory, which contains an additional playbooks directory. These playbooks
|
directory, which contains an additional playbooks directory. These playbooks
|
||||||
facilitate the upgrade process.
|
facilitate the upgrade process.
|
||||||
|
|
||||||
.. _lbaas-version-check:
|
|
||||||
|
|
||||||
lbaas-version-check.yml
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
This playbook is part of the general pre-flight checks.
|
|
||||||
|
|
||||||
Because LBaaS v1 isn't supported in |current_release_formal_name|
|
|
||||||
and above, and there is no migration path, the deployer will have
|
|
||||||
to manually disable LBaaS v1 before upgrading. For
|
|
||||||
openstack-ansible, we are checking if ``neutron_lbaas`` is set to
|
|
||||||
``False``, but additional operations are to be done by the deployer
|
|
||||||
for the cleanup.
|
|
||||||
|
|
||||||
.. _fact-cleanup-playbook:
|
.. _fact-cleanup-playbook:
|
||||||
|
|
||||||
ansible_fact_cleanup.yml
|
ansible_fact_cleanup.yml
|
||||||
@ -62,18 +48,6 @@ The presence of ``pip.conf`` locks down all Python installations to packages
|
|||||||
on the repo servers. If ``pip.conf`` exists on a repo server or a physical
|
on the repo servers. If ``pip.conf`` exists on a repo server or a physical
|
||||||
node, it will cause a circular dependency issue and the upgrade will fail.
|
node, it will cause a circular dependency issue and the upgrade will fail.
|
||||||
|
|
||||||
.. _old-hostname-compatibility:
|
|
||||||
|
|
||||||
old-hostname-compatibility.yml
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
This playbook ensures an alias is created for old hostnames that may not be
|
|
||||||
RFC 1034 or 1035 compatible. Using a hostname alias allows agents to continue
|
|
||||||
working in cases where the hostname is also the registered agent name. This
|
|
||||||
playbook is only needed for upgrades of in-place upgrades of existing nodes or
|
|
||||||
if a node is replaced or rebuilt it will be brought into the cluster using a
|
|
||||||
compliant hostname.
|
|
||||||
|
|
||||||
.. _setup-infra-playbook:
|
.. _setup-infra-playbook:
|
||||||
|
|
||||||
setup-infrastructure.yml
|
setup-infrastructure.yml
|
||||||
@ -113,13 +87,3 @@ memcached-flush.yml
|
|||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Sends "flush_all" to memcached with the help of nc.
|
Sends "flush_all" to memcached with the help of nc.
|
||||||
|
|
||||||
.. _aodh-api-init-delete:
|
|
||||||
|
|
||||||
aodh-api-init-delete.yml
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
Stops the ``aodh-api`` service and removes the init file since ``aodh-api``
|
|
||||||
now runs under Apache ``mod_wsgi``.
|
|
||||||
Run the ``os-aodh-install.yml`` playbook during the OpenStack services upgrade
|
|
||||||
to ensure ``aodh-api`` is available after running ``aodh-api-init-delete.yml``.
|
|
||||||
|
@ -147,12 +147,9 @@ function main {
|
|||||||
"${SCRIPTS_PATH}/bootstrap-ansible.sh"
|
"${SCRIPTS_PATH}/bootstrap-ansible.sh"
|
||||||
|
|
||||||
pushd ${MAIN_PATH}/playbooks
|
pushd ${MAIN_PATH}/playbooks
|
||||||
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/lbaas-version-check.yml")
|
|
||||||
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/ansible_fact_cleanup.yml")
|
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/ansible_fact_cleanup.yml")
|
||||||
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/deploy-config-changes.yml")
|
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/deploy-config-changes.yml")
|
||||||
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/user-secrets-adjustment.yml")
|
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/user-secrets-adjustment.yml")
|
||||||
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/mariadb-apt-cleanup.yml")
|
|
||||||
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/db-collation-alter.yml")
|
|
||||||
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/pip-conf-removal.yml")
|
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/pip-conf-removal.yml")
|
||||||
# we don't want to trigger galera container restarts yet
|
# we don't want to trigger galera container restarts yet
|
||||||
RUN_TASKS+=("setup-hosts.yml --limit '!galera_all'")
|
RUN_TASKS+=("setup-hosts.yml --limit '!galera_all'")
|
||||||
@ -161,7 +158,6 @@ function main {
|
|||||||
RUN_TASKS+=("haproxy-install.yml")
|
RUN_TASKS+=("haproxy-install.yml")
|
||||||
# rebuild the repo servers
|
# rebuild the repo servers
|
||||||
RUN_TASKS+=("repo-install.yml")
|
RUN_TASKS+=("repo-install.yml")
|
||||||
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/old-hostname-compatibility.yml")
|
|
||||||
# explicitly perform mariadb upgrade
|
# explicitly perform mariadb upgrade
|
||||||
RUN_TASKS+=("galera-install.yml -e 'galera_upgrade=true'")
|
RUN_TASKS+=("galera-install.yml -e 'galera_upgrade=true'")
|
||||||
# explicitly perform controlled galera cluster restart
|
# explicitly perform controlled galera cluster restart
|
||||||
@ -174,7 +170,6 @@ function main {
|
|||||||
RUN_TASKS+=("utility-install.yml")
|
RUN_TASKS+=("utility-install.yml")
|
||||||
RUN_TASKS+=("rsyslog-install.yml")
|
RUN_TASKS+=("rsyslog-install.yml")
|
||||||
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/memcached-flush.yml")
|
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/memcached-flush.yml")
|
||||||
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/aodh-api-init-delete.yml")
|
|
||||||
RUN_TASKS+=("setup-openstack.yml")
|
RUN_TASKS+=("setup-openstack.yml")
|
||||||
# Run the tasks in order
|
# Run the tasks in order
|
||||||
for item in ${!RUN_TASKS[@]}; do
|
for item in ${!RUN_TASKS[@]}; do
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2016, Logan Vig <logan2211@gmail.com>
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
- name: Delete aodh-api init file
|
|
||||||
hosts: aodh_all
|
|
||||||
gather_facts: false
|
|
||||||
user: root
|
|
||||||
pre_tasks:
|
|
||||||
- name: Check init system
|
|
||||||
command: cat /proc/1/comm
|
|
||||||
register: _pid1_name
|
|
||||||
- name: Set the name of pid1
|
|
||||||
set_fact:
|
|
||||||
pid1_name: "{{ _pid1_name.stdout }}"
|
|
||||||
tasks:
|
|
||||||
- name: Stop the aodh-api service
|
|
||||||
service:
|
|
||||||
name: aodh-api
|
|
||||||
state: stopped
|
|
||||||
enabled: no
|
|
||||||
- name: Remove the aodh-api upstart init file
|
|
||||||
file:
|
|
||||||
path: '/etc/init/aodh-api.conf'
|
|
||||||
state: absent
|
|
||||||
when: pid1_name == "init"
|
|
||||||
- name: Reload upstart init scripts
|
|
||||||
command: initctl reload-configuration
|
|
||||||
when: pid1_name == "init"
|
|
||||||
- name: Remove the aodh-api systemd init file
|
|
||||||
file:
|
|
||||||
path: '/etc/systemd/system/aodh-api.service'
|
|
||||||
when: pid1_name == "systemd"
|
|
||||||
- name: Reload systemd
|
|
||||||
command: systemctl daemon-reload
|
|
||||||
when: pid1_name == "systemd"
|
|
@ -1,57 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2016, @WalmartLabs
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
- name: Update database collations
|
|
||||||
hosts: galera_all[0]
|
|
||||||
gather_facts: false
|
|
||||||
user: root
|
|
||||||
tasks:
|
|
||||||
- name: Find tables with utf8_unicode_ci collation
|
|
||||||
command: >
|
|
||||||
mysql -e
|
|
||||||
"SELECT T.table_schema, T.table_name FROM information_schema.`TABLES` T,
|
|
||||||
information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA
|
|
||||||
WHERE CCSA.collation_name = T.table_collation AND CCSA.CHARACTER_SET_NAME = 'utf8'
|
|
||||||
AND CCSA.COLLATION_NAME = 'utf8_unicode_ci';"
|
|
||||||
register: utf8_unicode_ci_tables
|
|
||||||
- name: Disable global foreign key checks
|
|
||||||
command: >
|
|
||||||
mysql -e
|
|
||||||
"SET GLOBAL FOREIGN_KEY_CHECKS = 0;"
|
|
||||||
when: utf8_unicode_ci_tables.stdout_lines | length > 0
|
|
||||||
- name: Convert tables to utf8_general_ci collation
|
|
||||||
command: >
|
|
||||||
mysql -e
|
|
||||||
"ALTER TABLE {{ item.split()[1] }} CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;"
|
|
||||||
{{ item.split()[0] }}
|
|
||||||
with_items: "{{ utf8_unicode_ci_tables.stdout_lines }}"
|
|
||||||
when: item | search("^(?!table_schema)\w+\t\w+$")
|
|
||||||
- name: Enable global foreign key checks
|
|
||||||
command: >
|
|
||||||
mysql -e
|
|
||||||
"SET GLOBAL FOREIGN_KEY_CHECKS = 1;"
|
|
||||||
when: utf8_unicode_ci_tables.stdout_lines | length > 0
|
|
||||||
- name: Find databases with utf8_unicode_ci collation
|
|
||||||
command: >
|
|
||||||
mysql -e
|
|
||||||
"SELECT SCHEMA_NAME FROM information_schema.SCHEMATA
|
|
||||||
WHERE DEFAULT_CHARACTER_SET_NAME = 'utf8' AND DEFAULT_COLLATION_NAME = 'utf8_unicode_ci';"
|
|
||||||
register: utf8_unicode_ci_databases
|
|
||||||
- name: Convert databases to utf8_general_ci collation
|
|
||||||
command: >
|
|
||||||
mysql -e
|
|
||||||
"ALTER DATABASE {{ item }} CHARACTER SET utf8 COLLATE utf8_general_ci;"
|
|
||||||
with_items: "{{ utf8_unicode_ci_databases.stdout_lines }}"
|
|
||||||
when: item | search("^(?!SCHEMA_NAME)\w+$")
|
|
@ -1,27 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2016, Rackspace US, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
- name: Fail fast if LBaaS v1 is configured
|
|
||||||
hosts: localhost
|
|
||||||
connection: local
|
|
||||||
tasks:
|
|
||||||
- name: Checking if neutron_lbaas variable exists
|
|
||||||
fail:
|
|
||||||
msg: |
|
|
||||||
LBaaS v1 has been removed from OpenStack in Newton and there is no migration path for it.
|
|
||||||
Please implement LBaaS v2.
|
|
||||||
http://docs.openstack.org/developer/openstack-ansible-os_neutron/configure-network-services.html#special-notes-about-lbaas
|
|
||||||
when:
|
|
||||||
- neutron_lbaas is defined and neutron_lbaas | bool
|
|
@ -1,24 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2016, Rackspace US, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
- name: MariaDB apt sources cleanup
|
|
||||||
hosts: "hosts:all_containers"
|
|
||||||
gather_facts: false
|
|
||||||
user: root
|
|
||||||
tasks:
|
|
||||||
- name: Remove MariaDB repositories left over from Mitaka
|
|
||||||
apt_repository:
|
|
||||||
repo: "deb https://mirror.rackspace.com/mariadb/repo/10.0/ubuntu trusty main"
|
|
||||||
state: "absent"
|
|
@ -1,145 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2016, Rackspace US, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
- name: Set hostname alias for local lookup compatibility
|
|
||||||
hosts: all
|
|
||||||
gather_facts: true
|
|
||||||
tasks:
|
|
||||||
- name: Update Alias hostnames
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/hosts
|
|
||||||
insertafter: "^127.0.0.1"
|
|
||||||
regexp: "^127.0.1.1"
|
|
||||||
line: "127.0.1.1 {{ rfc_1034_1035_name }}.{{ domain_name }} {{ rfc_1034_1035_name }} {{ inventory_hostname }} {{ ansible_hostname }}"
|
|
||||||
state: present
|
|
||||||
register: result1
|
|
||||||
when:
|
|
||||||
- rfc_1034_1035_name != inventory_hostname
|
|
||||||
- rfc_1034_1035_name != ansible_hostname
|
|
||||||
- name: Update Alias hostnames
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/hosts
|
|
||||||
insertafter: "^127.0.0.1"
|
|
||||||
regexp: "^127.0.1.1"
|
|
||||||
line: "127.0.1.1 {{ rfc_1034_1035_name }}.{{ domain_name }} {{ rfc_1034_1035_name }} {{ ansible_hostname }}"
|
|
||||||
state: present
|
|
||||||
register: result2
|
|
||||||
when:
|
|
||||||
- rfc_1034_1035_name == inventory_hostname
|
|
||||||
- rfc_1034_1035_name != ansible_hostname
|
|
||||||
- name: Update Alias hostnames
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/hosts
|
|
||||||
insertafter: "^127.0.0.1"
|
|
||||||
regexp: "^127.0.1.1"
|
|
||||||
line: "127.0.1.1 {{ rfc_1034_1035_name }}.{{ domain_name }} {{ rfc_1034_1035_name }} {{ inventory_hostname }}"
|
|
||||||
state: present
|
|
||||||
when:
|
|
||||||
- result1 | skipped
|
|
||||||
- result2 | skipped
|
|
||||||
vars:
|
|
||||||
rfc_1034_1035_name: "{{ inventory_hostname | replace('_', '-') }}"
|
|
||||||
domain_name: "{{ openstack_domain|default('openstack.local') }}"
|
|
||||||
|
|
||||||
- name: Set hostnames alias for RabbitMQ lookup compatibility
|
|
||||||
hosts: rabbitmq_all
|
|
||||||
tasks:
|
|
||||||
- name: Update hosts file from ansible inventory
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/hosts
|
|
||||||
regexp: "^{{ hostvars[item]['ansible_ssh_host'] }}"
|
|
||||||
line: "{{ hostvars[item]['ansible_ssh_host'] }} {{ rfc_1034_1035_name }}.{{ domain_name }} {{ rfc_1034_1035_name }} {{ item }}"
|
|
||||||
state: present
|
|
||||||
when: item != inventory_hostname
|
|
||||||
with_items: "{{ play_hosts }}"
|
|
||||||
vars:
|
|
||||||
rfc_1034_1035_name: "{{ item | replace('_', '-') }}"
|
|
||||||
domain_name: "{{ openstack_domain|default('openstack.local') }}"
|
|
||||||
|
|
||||||
- name: Set hostnames alias for MariaDB lookup compatibility
|
|
||||||
hosts: galera_all
|
|
||||||
tasks:
|
|
||||||
- name: Update hosts file from ansible inventory
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/hosts
|
|
||||||
regexp: "^{{ hostvars[item]['ansible_ssh_host'] }}"
|
|
||||||
line: "{{ hostvars[item]['ansible_ssh_host'] }} {{ rfc_1034_1035_name }}.{{ domain_name }} {{ rfc_1034_1035_name }} {{ item }}"
|
|
||||||
state: present
|
|
||||||
when: item != inventory_hostname
|
|
||||||
with_items: "{{ play_hosts }}"
|
|
||||||
vars:
|
|
||||||
rfc_1034_1035_name: "{{ item | replace('_', '-') }}"
|
|
||||||
domain_name: "{{ openstack_domain|default('openstack.local') }}"
|
|
||||||
|
|
||||||
- name: Set hostnames alias for Neutron Agent lookup compatibility
|
|
||||||
hosts: neutron_all:!nova_compute
|
|
||||||
tasks:
|
|
||||||
- name: Update hosts file from ansible inventory
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/hosts
|
|
||||||
regexp: "^{{ hostvars[item]['ansible_ssh_host'] }}"
|
|
||||||
line: "{{ hostvars[item]['ansible_ssh_host'] }} {{ rfc_1034_1035_name }}.{{ domain_name }} {{ rfc_1034_1035_name }} {{ item }}"
|
|
||||||
state: present
|
|
||||||
when: item != inventory_hostname
|
|
||||||
with_items: "{{ play_hosts }}"
|
|
||||||
vars:
|
|
||||||
rfc_1034_1035_name: "{{ item | replace('_', '-') }}"
|
|
||||||
domain_name: "{{ openstack_domain|default('openstack.local') }}"
|
|
||||||
|
|
||||||
- name: Set hostnames alias for Cinder lookup compatibility
|
|
||||||
hosts: cinder_all
|
|
||||||
tasks:
|
|
||||||
- name: Update hosts file from ansible inventory
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/hosts
|
|
||||||
regexp: "^{{ hostvars[item]['ansible_ssh_host'] }}"
|
|
||||||
line: "{{ hostvars[item]['ansible_ssh_host'] }} {{ rfc_1034_1035_name }}.{{ domain_name }} {{ rfc_1034_1035_name }} {{ item }}"
|
|
||||||
state: present
|
|
||||||
when: item != inventory_hostname
|
|
||||||
with_items: "{{ play_hosts }}"
|
|
||||||
vars:
|
|
||||||
rfc_1034_1035_name: "{{ item | replace('_', '-') }}"
|
|
||||||
domain_name: "{{ openstack_domain|default('openstack.local') }}"
|
|
||||||
|
|
||||||
- name: Set hostnames alias for Heat lookup compatibility
|
|
||||||
hosts: heat_all
|
|
||||||
tasks:
|
|
||||||
- name: Update hosts file from ansible inventory
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/hosts
|
|
||||||
regexp: "^{{ hostvars[item]['ansible_ssh_host'] }}"
|
|
||||||
line: "{{ hostvars[item]['ansible_ssh_host'] }} {{ rfc_1034_1035_name }}.{{ domain_name }} {{ rfc_1034_1035_name }} {{ item }}"
|
|
||||||
state: present
|
|
||||||
when: item != inventory_hostname
|
|
||||||
with_items: "{{ play_hosts }}"
|
|
||||||
vars:
|
|
||||||
rfc_1034_1035_name: "{{ item | replace('_', '-') }}"
|
|
||||||
domain_name: "{{ openstack_domain|default('openstack.local') }}"
|
|
||||||
|
|
||||||
- name: Set hostnames alias for Nova Sevice lookup compatibility
|
|
||||||
hosts: nova_all:!nova_compute
|
|
||||||
tasks:
|
|
||||||
- name: Update hosts file from ansible inventory
|
|
||||||
lineinfile:
|
|
||||||
dest: /etc/hosts
|
|
||||||
regexp: "^{{ hostvars[item]['ansible_ssh_host'] }}"
|
|
||||||
line: "{{ hostvars[item]['ansible_ssh_host'] }} {{ rfc_1034_1035_name }}.{{ domain_name }} {{ rfc_1034_1035_name }} {{ item }}"
|
|
||||||
state: present
|
|
||||||
when:
|
|
||||||
- item != inventory_hostname
|
|
||||||
with_items: "{{ play_hosts }}"
|
|
||||||
vars:
|
|
||||||
rfc_1034_1035_name: "{{ item | replace('_', '-') }}"
|
|
||||||
domain_name: "{{ openstack_domain|default('openstack.local') }}"
|
|
Loading…
Reference in New Issue
Block a user