From: Andrew Schoen Date: Thu, 30 Apr 2015 20:19:33 +0000 (-0500) Subject: downstream-setup: adds a new downstream_setup.yml playbook. X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=7a8dbf0a5a543e3cf921032f45896dd3a29d8580;p=ceph-cm-ansible.git downstream-setup: adds a new downstream_setup.yml playbook. 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": "", "name": "name"}]}' Signed-off-by: Andrew Schoen --- diff --git a/downstream_setup.yml b/downstream_setup.yml new file mode 100644 index 0000000..8de896d --- /dev/null +++ b/downstream_setup.yml @@ -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 index 0000000..f991bf6 --- /dev/null +++ b/roles/downstream-setup/defaults/main.yml @@ -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 index 0000000..7b78b65 --- /dev/null +++ b/roles/downstream-setup/tasks/main.yml @@ -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 index 0000000..d6eafeb --- /dev/null +++ b/roles/downstream-setup/tasks/yum_repos.yml @@ -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