diff --git a/playbooks/hook-dummy.yml b/playbooks/hook-dummy.yml new file mode 100644 index 0000000000..a5816056f6 --- /dev/null +++ b/playbooks/hook-dummy.yml @@ -0,0 +1,3 @@ +- name: Placeholder hook + hosts: localhost + gather_facts: false diff --git a/playbooks/setup-hosts.yml b/playbooks/setup-hosts.yml index b124a872b3..9b415071d8 100644 --- a/playbooks/setup-hosts.yml +++ b/playbooks/setup-hosts.yml @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Importing pre hook playbook + import_playbook: "{{ pre_setup_hosts_hook | default('hook-dummy.yml') }}" + - name: Importing certificate-authority playbook import_playbook: certificate-authority.yml @@ -30,3 +33,6 @@ - name: Importing security-hardening playbook import_playbook: security-hardening.yml + +- name: Importing post hook playbook + import_playbook: "{{ post_setup_hosts_hook | default('hook-dummy.yml') }}" diff --git a/playbooks/setup-infrastructure.yml b/playbooks/setup-infrastructure.yml index ef39c6f719..e1bddff40b 100644 --- a/playbooks/setup-infrastructure.yml +++ b/playbooks/setup-infrastructure.yml @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Importing pre hook playbook + import_playbook: "{{ pre_setup_infrastructure_hook | default('hook-dummy.yml') }}" + - name: Importing unbound-install playbook import_playbook: unbound-install.yml @@ -52,3 +55,6 @@ - name: Importing infra-journal-remote playbook import_playbook: infra-journal-remote.yml when: journald_remote_enabled | default (false) | bool + +- name: Importing post hook playbook + import_playbook: "{{ post_setup_infrastructure_hook | default('hook-dummy.yml') }}" diff --git a/playbooks/setup-openstack.yml b/playbooks/setup-openstack.yml index 065a9bdc80..06bf85630a 100644 --- a/playbooks/setup-openstack.yml +++ b/playbooks/setup-openstack.yml @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Importing pre hook playbook + import_playbook: "{{ pre_setup_openstack_hook | default('hook-dummy.yml') }}" + - name: Importing os-keystone-install playbook import_playbook: os-keystone-install.yml @@ -110,3 +113,6 @@ - name: Importing os-rally-install playbook import_playbook: os-rally-install.yml + +- name: Importing post hook playbook + import_playbook: "{{ post_setup_openstack_hook | default('hook-dummy.yml') }}" diff --git a/releasenotes/notes/hook-playbooks-b71dbdd7835af2aa.yaml b/releasenotes/notes/hook-playbooks-b71dbdd7835af2aa.yaml new file mode 100644 index 0000000000..b250d3dde2 --- /dev/null +++ b/releasenotes/notes/hook-playbooks-b71dbdd7835af2aa.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + New variables are added to allow a user defined playbooks to be specified + that run pre and post the existing code in setup-hosts, setup-infrastructure + and setup-openstack. OpenStack-Ansible deployments may be extended and + have additional user defined functions added using these hooks, which + will have full access to the OSA inventory and host variables.