summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortzumainn <tzumainn@redhat.com>2017-08-31 04:38:38 -0400
committerTomas Sedovic <tomas@sedovic.cz>2017-08-31 10:38:38 +0200
commit8008fd49227a750a6a5cf5cae8700f0fe0970bce (patch)
tree4eaf0648c0d6c32c7f0d8e8aaff6cee4027e6acd
parent845bae93f8bbf489fbc9508ae98237467b1ce6e1 (diff)
downloadopenshift-8008fd49227a750a6a5cf5cae8700f0fe0970bce.tar.gz
openshift-8008fd49227a750a6a5cf5cae8700f0fe0970bce.tar.bz2
openshift-8008fd49227a750a6a5cf5cae8700f0fe0970bce.tar.xz
openshift-8008fd49227a750a6a5cf5cae8700f0fe0970bce.zip
Add custom post-provision playbook for adding yum repos (#697)
* Add custom post-provision playbook for adding yum repos * fixed formatting issues * requested corrections and formatting changes
-rw-r--r--playbooks/provisioning/openstack/README.md26
-rw-r--r--playbooks/provisioning/openstack/custom-actions/add-yum-repos.yml12
2 files changed, 29 insertions, 9 deletions
diff --git a/playbooks/provisioning/openstack/README.md b/playbooks/provisioning/openstack/README.md
index 2eb9aa9cd..57d5839c8 100644
--- a/playbooks/provisioning/openstack/README.md
+++ b/playbooks/provisioning/openstack/README.md
@@ -325,7 +325,19 @@ if requested, and DNS server, and ensures other OpenShift requirements to be met
### Running Custom Post-Provision Actions
-If you'd like to run post-provision actions, you can do so by creating a custom playbook. Here's one example that adds additional YUM repositories:
+A custom playbook can be run like this:
+
+```
+ansible-playbook --private-key ~/.ssh/openshift -i inventory/ openshift-ansible-contrib/playbooks/provisioning/openstack/custom-actions/custom-playbook.yml
+```
+
+If you'd like to limit the run to one particular host, you can do so as follows:
+
+```
+ansible-playbook --private-key ~/.ssh/openshift -i inventory/ openshift-ansible-contrib/playbooks/provisioning/openstack/custom-actions/custom-playbook.yml -l app-node-0.openshift.example.com
+```
+
+You can also create your own custom playbook. Here's one example that adds additional YUM repositories:
```
---
@@ -349,17 +361,13 @@ This example runs against app nodes. The list of options include:
- masters
- infra_hosts
-After writing your custom playbook, run it like this:
+Please consider contributing your custom playbook back to openshift-ansible-contrib!
-```
-ansible-playbook --private-key ~/.ssh/openshift -i myinventory/ custom-playbook.yaml
-```
+A library of custom post-provision actions exists in `openshift-ansible-contrib/playbooks/provisioning/openstack/custom-actions`. Playbooks include:
-If you'd like to limit the run to one particular host, you can do so as follows:
+##### add-yum-repos.yml
-```
-ansible-playbook --private-key ~/.ssh/openshift -i myinventory/ custom-playbook.yaml -l app-node-0.openshift.example.com
-```
+[add-yum-repos.yml](https://github.com/openshift/openshift-ansible-contrib/blob/master/playbooks/provisioning/openstack/custom-actions/add-yum-repos.yml) adds a list of custom yum repositories to every node in the cluster.
### Install OpenShift
diff --git a/playbooks/provisioning/openstack/custom-actions/add-yum-repos.yml b/playbooks/provisioning/openstack/custom-actions/add-yum-repos.yml
new file mode 100644
index 000000000..ffebcb642
--- /dev/null
+++ b/playbooks/provisioning/openstack/custom-actions/add-yum-repos.yml
@@ -0,0 +1,12 @@
+---
+- hosts: cluster_hosts
+ vars:
+ yum_repos: []
+ tasks:
+ # enable additional yum repos
+ - name: Add repository
+ yum_repository:
+ name: "{{ item.name }}"
+ description: "{{ item.description }}"
+ baseurl: "{{ item.baseurl }}"
+ with_items: "{{ yum_repos }}"