summaryrefslogtreecommitdiffstats
path: root/roles/openshift_openstack
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-02-12 10:33:45 -0800
committerGitHub <noreply@github.com>2018-02-12 10:33:45 -0800
commitf9f61beed982ba841c872b5fc082c6dc05ad27b1 (patch)
treecea87fe39ebf5c7f26c9c4e70ff991a12659d24b /roles/openshift_openstack
parentf1263cb5edbe409fd044a37a395cc5b49e48dfeb (diff)
parentaafbd31f00f48ee9e3e1aaea8f5f316669262872 (diff)
downloadopenshift-f9f61beed982ba841c872b5fc082c6dc05ad27b1.tar.gz
openshift-f9f61beed982ba841c872b5fc082c6dc05ad27b1.tar.bz2
openshift-f9f61beed982ba841c872b5fc082c6dc05ad27b1.tar.xz
openshift-f9f61beed982ba841c872b5fc082c6dc05ad27b1.zip
Merge pull request #6699 from bogdando/heat_user_data
Automatic merge from submit-queue. [openstack] custom user commands for cloud-init Allow to specify additional user commands executed on all Nova servers provisioned via Heat. An example use case is installing and starting os-collect-config agents to put Nova servers under the configuration management driven via the host openstack cloud Heat services. This allows to integrate with another deployment tools like TripleO. Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
Diffstat (limited to 'roles/openshift_openstack')
-rw-r--r--roles/openshift_openstack/defaults/main.yml2
-rw-r--r--roles/openshift_openstack/templates/user_data.j216
2 files changed, 18 insertions, 0 deletions
diff --git a/roles/openshift_openstack/defaults/main.yml b/roles/openshift_openstack/defaults/main.yml
index 75bed96f0..75f1300e1 100644
--- a/roles/openshift_openstack/defaults/main.yml
+++ b/roles/openshift_openstack/defaults/main.yml
@@ -96,6 +96,8 @@ openshift_openstack_etcd_volume_size: 2
openshift_openstack_lb_volume_size: 5
openshift_openstack_ephemeral_volumes: false
+# User commands for cloud-init executed on all Nova servers provisioned
+openshift_openstack_provision_user_commands: []
# cloud-config
openshift_openstack_disable_root: true
diff --git a/roles/openshift_openstack/templates/user_data.j2 b/roles/openshift_openstack/templates/user_data.j2
index ccaa5d464..1ca87a429 100644
--- a/roles/openshift_openstack/templates/user_data.j2
+++ b/roles/openshift_openstack/templates/user_data.j2
@@ -11,3 +11,19 @@ write_files:
permissions: 440
content: |
Defaults:openshift !requiretty
+
+{% if openshift_openstack_provision_user_commands %}
+ - path: /root/ansible_install.sh
+ permissions: '0544'
+ content: |
+{% for cmd in openshift_openstack_provision_user_commands %}
+{% if cmd is string %}
+ {{ cmd }}
+{% elif cmd is iterable %}
+ {{ cmd|join(' ') }}
+{% endif %}
+{% endfor %}
+
+runcmd:
+ - /root/ansible_install.sh
+{% endif %}