From e2acef2597b93b7a58a64283ce60bfda77b059c8 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Fri, 20 Nov 2015 15:50:48 -0500 Subject: [PATCH] Add os-client-config support Change-Id: I6dd96af86d8a080ff7a6f5700f8b52e3ad770151 Signed-off-by: Paul Belanger --- defaults/main.yaml | 4 ++++ tasks/config.yaml | 7 +++++++ .../var/lib/nodepool/.config/openstack/clouds.yaml.j2 | 5 +++++ 3 files changed, 16 insertions(+) create mode 100644 templates/var/lib/nodepool/.config/openstack/clouds.yaml.j2 diff --git a/defaults/main.yaml b/defaults/main.yaml index 93e771a..16a1847 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -24,6 +24,10 @@ nodepool_config_zmq_publishers: [] nodepool_file_logging_conf: etc/nodepool/logging.conf +nodepool_template_clouds_yaml_contents: "" +nodepool_template_clouds_yaml_dest: /var/lib/nodepool/.config/openstack/clouds.yaml +nodepool_template_clouds_yaml_src: var/lib/nodepool/.config/openstack/clouds.yaml.j2 + nodepool_template_nodepool_yaml_contents: | diskimages: [] labels: [] diff --git a/tasks/config.yaml b/tasks/config.yaml index 5b1b4ea..f0736b4 100644 --- a/tasks/config.yaml +++ b/tasks/config.yaml @@ -27,8 +27,15 @@ with_items: - /etc/nodepool - "{{ nodepool_config_images_dir }}" + - /var/lib/nodepool/.config/openstack - /var/log/nodepool +- name: Template clouds yaml file. + template: + dest: "{{ nodepool_template_clouds_yaml_dest }}" + src: "{{ nodepool_template_clouds_yaml_src }}" + notify: Restart nodepool + - name: Template secure configuration file. template: dest: "{{ nodepool_template_secure_conf_dest }}" diff --git a/templates/var/lib/nodepool/.config/openstack/clouds.yaml.j2 b/templates/var/lib/nodepool/.config/openstack/clouds.yaml.j2 new file mode 100644 index 0000000..a1ae074 --- /dev/null +++ b/templates/var/lib/nodepool/.config/openstack/clouds.yaml.j2 @@ -0,0 +1,5 @@ +# This file is generated by Ansible +# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN +# +{{ nodepool_template_clouds_yaml_contents }} +# {{ ansible_managed }}