diff --git a/docs/source/index.rst b/docs/source/index.rst index 0a5f9cd31..a4e65fb9f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -16,6 +16,7 @@ Contents: usage roles plugins + playbooks Indices and tables ================== diff --git a/docs/source/playbooks.rst b/docs/source/playbooks.rst new file mode 100644 index 000000000..63d1d554a --- /dev/null +++ b/docs/source/playbooks.rst @@ -0,0 +1,9 @@ +Playbooks in EDPM-Ansible +========================= + +Contents: + +.. toctree:: + :glob: + + playbooks/* diff --git a/docs/source/playbooks/install_os.rst b/docs/source/playbooks/install_os.rst new file mode 100644 index 000000000..72e77eab3 --- /dev/null +++ b/docs/source/playbooks/install_os.rst @@ -0,0 +1,19 @@ +===================== +Playbook - install_os +===================== + +Installs services necessary for the EDPM operation. +Uses external `timesync` role from `system roles collection`_ to both install and configure chrony. + +-------------------------- +Time service configuration +-------------------------- + +Variables of the `timesync`_ system role can be overriden in a standard ansible way, +while respecting resolution order. Default values are set in the `install_os` playbook, +while allowing for override. + +All variables of the timesync role can used while using this playbook. + +.. _`system roles collection`: https://linux-system-roles.github.io/ +.. _`timesync`: https://github.com/linux-system-roles/timesync diff --git a/playbooks/configure_os.yml b/playbooks/configure_os.yml index f79818fd1..e59a91e34 100644 --- a/playbooks/configure_os.yml +++ b/playbooks/configure_os.yml @@ -30,6 +30,7 @@ tags: - edpm_sshd - name: Configure edpm_chrony + when: timesync_ntp_servers is not defined ansible.builtin.import_role: name: osp.edpm.edpm_chrony tasks_from: config.yml diff --git a/playbooks/install_os.yml b/playbooks/install_os.yml index 2bc93c636..c03d4f7f5 100644 --- a/playbooks/install_os.yml +++ b/playbooks/install_os.yml @@ -17,12 +17,29 @@ tasks_from: install.yml tags: - edpm_sshd + - name: Set up time services + when: timesync_ntp_servers is defined + block: + - name: Set FQCN for the timesync role + ansible.builtin.set_fact: + timesyncfqcn: + "{%- if ansible_facts['distribution'] == 'RedHat' -%} + redhat.rhel{%- else -%} + fedora.linux{%- endif -%} + _system_roles.timesync" + delegate_to: localhost + - name: Install and configure time service using timesync system role + ansible.builtin.include_role: + name: "{{timesyncfqcn}}" + tags: + - dataplane_chrony - name: Install edpm_chrony ansible.builtin.import_role: name: osp.edpm.edpm_chrony tasks_from: install.yml tags: - edpm_chrony + when: timesync_ntp_servers is not defined - name: Install edpm_logrotate_crond ansible.builtin.import_role: name: osp.edpm.edpm_logrotate_crond diff --git a/playbooks/run_os.yml b/playbooks/run_os.yml index f8c8bdb77..af1d616c7 100644 --- a/playbooks/run_os.yml +++ b/playbooks/run_os.yml @@ -11,24 +11,27 @@ tasks_from: run.yml tags: - edpm_sshd - - name: Run edpm_chrony - ansible.builtin.import_role: - name: osp.edpm.edpm_chrony - tasks_from: run.yml - tags: - - edpm_chrony - - name: Run edpm_chrony (Online) - ansible.builtin.import_role: - name: osp.edpm.edpm_chrony - tasks_from: online.yml - tags: - - edpm_chrony - - name: Run edpm_chrony (Sync) - ansible.builtin.import_role: - name: osp.edpm.edpm_chrony - tasks_from: sync.yml - tags: - - edpm_chrony + - name: Run edpm_chrony role + when: timesync_ntp_servers is not defined + block: + - name: Run edpm_chrony + ansible.builtin.import_role: + name: osp.edpm.edpm_chrony + tasks_from: run.yml + tags: + - edpm_chrony + - name: Run edpm_chrony (Online) + ansible.builtin.import_role: + name: osp.edpm.edpm_chrony + tasks_from: online.yml + tags: + - edpm_chrony + - name: Run edpm_chrony (Sync) + ansible.builtin.import_role: + name: osp.edpm.edpm_chrony + tasks_from: sync.yml + tags: + - edpm_chrony - name: Run edpm_timezone ansible.builtin.import_role: name: osp.edpm.edpm_timezone