Add a role to disable glean

Also removes interface configuration files created by Glean as kayobe expects
to manage all interfaces.
This commit is contained in:
Mark Goddard 2017-05-25 15:43:17 +01:00
parent e2bb70db95
commit dc7c2d9c6c
5 changed files with 90 additions and 2 deletions

View File

@ -0,0 +1,8 @@
---
# Glean/simple-init is useful for reading configdrive data when provisioning
# servers but gets in the way after this as it tries to enable all network
# interfaces. In some cases this can lead to timeouts.
- name: Ensure Glean is disabled and its artifacts are removed
hosts: seed:controllers
roles:
- role: disable-glean

View File

@ -0,0 +1,37 @@
Disable Glean
=============
Ansible role to disable services and remove artifacts left after using
[Glean](https://github.com/openstack-infra/glean>).
Glean enables DHCP on all network interfaces that are not explicitly
configured. If no DHCP server is configured to make an offer to these
interfaces, they will time out on boot and cause the network service to fail.
Requirements
------------
None
Role Variables
--------------
None
Dependencies
------------
None
Example Playbook
----------------
---
- hosts: all
roles:
- role: disable-glean
Author Information
------------------
- Mark Goddard (<mark@stackhpc.com>)

View File

@ -0,0 +1,4 @@
---
- name: Reload systemd daemon
command: systemctl daemon-reload
become: True

View File

@ -0,0 +1,38 @@
---
- name: Check for existing Glean systemd services
command: systemctl list-units glean*.service --no-legend --no-pager
register: glean_services
changed_when: False
- name: Ensure Glean services are stopped and disabled
service:
name: "{{ item.split()[0] }}"
state: stopped
enabled: no
with_items: "{{ glean_services.stdout_lines }}"
- name: Find interface configuration files created by Glean
find:
path: "/etc/sysconfig/network-scripts"
pattern: "ifcfg-*"
# This comment is added by Glean to interface configuration files.
contains: "# Automatically generated, do not edit"
register: interface_configs
- name: Ensure interface configuration files created by Glean are removed
file:
path: "{{ item }}"
state: absent
with_items: "{{ interface_configs.files | map(attribute='path') | list }}"
become: True
- name: Ensure Glean artifacts are removed
file:
path: "{{ item }}"
state: absent
with_items:
- "/usr/lib/systemd/system/glean@.service"
- "/etc/udev/rules.d/99-glean.rules"
become: True
notify:
- Reload systemd daemon

View File

@ -256,7 +256,7 @@ class SeedHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin,
playbooks += _build_playbook_list("wipe-disks")
playbooks += _build_playbook_list(
"dev-tools", "disable-selinux", "network", "ip-routing", "snat",
"ntp", "lvm")
"disable-glean", "ntp", "lvm")
self.run_kayobe_playbooks(parsed_args, playbooks, limit="seed")
self.run_kolla_ansible_seed(parsed_args, "bootstrap-servers",
extra_vars={"ansible_user": ansible_user})
@ -379,7 +379,8 @@ class OvercloudHostConfigure(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin,
if parsed_args.wipe_disks:
playbooks += _build_playbook_list("wipe-disks")
playbooks += _build_playbook_list(
"dev-tools", "disable-selinux", "network", "ntp", "lvm")
"dev-tools", "disable-selinux", "network", "disable-glean", "ntp",
"lvm")
self.run_kayobe_playbooks(parsed_args, playbooks, limit="controllers")
extra_vars = {"ansible_user": ansible_user}
self.run_kolla_ansible_overcloud(parsed_args, "bootstrap-servers",