]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
downstream-setup: adds a new downstream_setup.yml playbook.
authorAndrew Schoen <aschoen@redhat.com>
Thu, 30 Apr 2015 20:19:33 +0000 (15:19 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Mon, 18 May 2015 21:27:16 +0000 (16:27 -0500)
This playbook will be used to setup testnodes for downstream
testing by downloading arbitrary yum repos. The repos to install should
be passed in with the --extra-vars option to ansible-playbook.

The yum_repos var must be a list of hashes defining the url to download
the repo from and the name to save it as in /etc/yum.repos.d

For example:

  --extra-vars '{"yum_repos":[{"url": "<url>", "name": "name"}]}'

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
downstream_setup.yml [new file with mode: 0644]
roles/downstream-setup/defaults/main.yml [new file with mode: 0644]
roles/downstream-setup/tasks/main.yml [new file with mode: 0644]
roles/downstream-setup/tasks/yum_repos.yml [new file with mode: 0644]

diff --git a/downstream_setup.yml b/downstream_setup.yml
new file mode 100644 (file)
index 0000000..8de896d
--- /dev/null
@@ -0,0 +1,6 @@
+---
+# A playbook used to setup a node for downstream
+# RHCeph testing.
+- hosts: testnodes
+  roles:
+    - downstream-setup
diff --git a/roles/downstream-setup/defaults/main.yml b/roles/downstream-setup/defaults/main.yml
new file mode 100644 (file)
index 0000000..f991bf6
--- /dev/null
@@ -0,0 +1,11 @@
+---
+# yum_repos is a list of hashes that
+# define the url to download the yum repo
+# from and the name to save it as in etc/yum.repos.d
+#
+# For example:
+#   yum_repos:
+#     - url: "http://path/to/epel.repo"
+#       name: "epel"
+#
+yum_repos: []
diff --git a/roles/downstream-setup/tasks/main.yml b/roles/downstream-setup/tasks/main.yml
new file mode 100644 (file)
index 0000000..7b78b65
--- /dev/null
@@ -0,0 +1,4 @@
+---
+- include: yum_repos.yml
+  tags:
+    - yum-repos
diff --git a/roles/downstream-setup/tasks/yum_repos.yml b/roles/downstream-setup/tasks/yum_repos.yml
new file mode 100644 (file)
index 0000000..d6eafeb
--- /dev/null
@@ -0,0 +1,7 @@
+---
+- name: Download yum repos to /etc/yum.repos.d
+  get_url:
+    url: "{{ item.url }}"
+    dest: "/etc/yum.repos.d/{{ item.name }}.repo"
+    force: yes
+  with_items: yum_repos