From: David Galloway Date: Thu, 9 Feb 2017 18:32:05 +0000 (-0500) Subject: public_facing: Create base role config X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a99a6686c0f2cca8667b95cba61ea30ac14d2aea;p=ceph-cm-ansible.git public_facing: Create base role config Signed-off-by: David Galloway --- diff --git a/public_facing.yml b/public_facing.yml new file mode 100644 index 0000000..bf80e38 --- /dev/null +++ b/public_facing.yml @@ -0,0 +1,5 @@ +--- +- hosts: public_facing + roles: + - public_facing + become: true diff --git a/roles/public_facing/README.rst b/roles/public_facing/README.rst new file mode 100644 index 0000000..63776af --- /dev/null +++ b/roles/public_facing/README.rst @@ -0,0 +1,20 @@ +public_facing +============= + +This role is used to manage the various public-facing hosts we have. Each host has various configs not managed by the ``common`` role. This playbook aims to: + +- Provide automation in the event of disaster recovery +- Automate repeatable tasks +- Automate 'one-off' host or service nuances + +Usage ++++++ + +Example:: + + ansible-playbook public_facing.yml --limit="download.ceph.com" + +Variables ++++++++++ + +For the most part, each host will have its own unique variables. See the playbook comments for details. diff --git a/roles/public_facing/tasks/main.yml b/roles/public_facing/tasks/main.yml new file mode 100644 index 0000000..8ff5623 --- /dev/null +++ b/roles/public_facing/tasks/main.yml @@ -0,0 +1,13 @@ +--- +# local_action in the task after this causes 'ansible_host' to change to 'localhost' +# we set a temporary variable here to search for in the local_action task +- set_fact: + target_host: "{{ ansible_host }}" + +- name: Check for host-specific playbooks + local_action: "stat path=roles/public_facing/tasks/{{ target_host }}.yml" + register: host_playbook + +- name: Include any host-specific playbooks if present + include: "{{ ansible_host }}.yml" + when: host_playbook.stat.exists