Add disable cloud-init support

This commit is contained in:
Dirane TAFEN 2018-02-20 11:44:49 +00:00
parent 58efaee1b7
commit b66c740799
7 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,12 @@
---
# Cloud-init s searches for network configuration in order of
# increasing precedence; each item overriding the previous.
# In some cases cloud-init reconfigure automatically network interface
# and cause some issues in network configuration
- name: Disable Cloud-init service
hosts: overcloud
tags:
- disable-cloud-init
roles:
- role: disable-cloud-init
when: disable_cloud_init | bool

View File

@ -16,6 +16,9 @@ overcloud_groups: >
# should not be added to the inventory.
overcloud_group_hosts_map: {}
# To prevent some network issues you can choose to disable cloud-init
disable_cloud_init: False
###############################################################################
# Overcloud host image configuration.

View File

@ -0,0 +1,7 @@
---
- name: restart cloud-init daemon
systemd:
name: cloud-init
state: restarted
daemon_reload: yes
become: True

View File

@ -0,0 +1,9 @@
---
- name: Disable cloud init service
file:
path: /etc/cloud/cloud-init.disabled
state: touch
mode: "u=rw,g=r,o=r"
notify:
- restart cloud-init daemon
become: True

View File

@ -13,6 +13,9 @@
# should not be added to the inventory.
#overcloud_group_hosts_map:
# To prevent some network issues you can choose to disable cloud-init
disable_cloud_init: False
###############################################################################
# Overcloud host image configuration.

View File

@ -691,7 +691,7 @@ class OvercloudHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin,
playbooks += _build_playbook_list("wipe-disks")
playbooks += _build_playbook_list(
"users", "yum", "dev-tools", "disable-selinux", "network",
"sysctl", "disable-glean", "ntp", "lvm")
"sysctl", "disable-glean", "disable-cloud-init", "ntp", "lvm")
self.run_kayobe_playbooks(parsed_args, playbooks, limit="overcloud")
playbooks = _build_playbook_list("kolla-ansible")
self.run_kayobe_playbooks(parsed_args, playbooks, tags="config")

View File

@ -466,6 +466,7 @@ class TestCase(unittest.TestCase):
"ansible/network.yml",
"ansible/sysctl.yml",
"ansible/disable-glean.yml",
"ansible/disable-cloud-init.yml",
"ansible/ntp.yml",
"ansible/lvm.yml",
],