]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
public_facing: Create base role config
authorDavid Galloway <dgallowa@redhat.com>
Thu, 9 Feb 2017 18:32:05 +0000 (13:32 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 23 Feb 2017 23:31:43 +0000 (18:31 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
public_facing.yml [new file with mode: 0644]
roles/public_facing/README.rst [new file with mode: 0644]
roles/public_facing/tasks/main.yml [new file with mode: 0644]

diff --git a/public_facing.yml b/public_facing.yml
new file mode 100644 (file)
index 0000000..bf80e38
--- /dev/null
@@ -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 (file)
index 0000000..63776af
--- /dev/null
@@ -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 (file)
index 0000000..8ff5623
--- /dev/null
@@ -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