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 }}