From 3d4093672a0611963a4388bcab1d6834c2b0c660 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Tue, 6 Aug 2019 16:10:09 -0500 Subject: [PATCH] Separate tripleo-time into two distinct roles This change converts the tripleo time role into two roles: - tripleo-ptp - tripleo-timezone This change will ensure we're able to cleanly install and setup ptp when needed while also providing a well defined interface for setting the timezone on systems. Change-Id: I0a2b2241a38f3d98ac421e6106fb81210961c1f5 Signed-off-by: Kevin Carter --- doc/source/roles/role-tripleo-time.rst | 8 +-- doc/source/roles/role-tripleo-timezone.rst | 6 ++ .../defaults/main.yml | 2 - .../handlers/main.yml | 8 --- .../roles/tripleo-ptp/meta/main.yml | 45 ++++++++++++ .../molecule/default/Dockerfile | 0 .../molecule/default/molecule.yml | 0 .../molecule/default/playbook.yml | 2 +- .../molecule/default/prepare.yml | 0 .../molecule/ntp_stop/Dockerfile | 0 .../molecule/ntp_stop/molecule.yml | 0 .../molecule/ntp_stop/playbook.yml | 2 +- .../molecule/ntp_stop/prepare.yml | 0 .../tasks/main.yml | 11 ++- .../tasks/tripleo_ntp_stop.yml | 0 .../tasks/tripleo_phc2sys.yml | 0 .../tasks/tripleo_ptp.yml | 0 .../templates/ptp4l.conf.j2 | 0 .../vars/redhat.yml | 0 .../roles/tripleo-timezone/defaults/main.yml | 20 ++++++ .../roles/tripleo-timezone/handlers/main.yml | 24 +++++++ .../meta/main.yml | 2 +- .../molecule/default/Dockerfile | 37 ++++++++++ .../molecule/default/molecule.yml | 68 +++++++++++++++++++ .../molecule/default/playbook.yml | 21 ++++++ .../molecule/default/prepare.yml | 21 ++++++ .../roles/tripleo-timezone/tasks/main.yml | 27 ++++++++ zuul.d/molecule.yaml | 21 ++++-- 28 files changed, 295 insertions(+), 30 deletions(-) create mode 100644 doc/source/roles/role-tripleo-timezone.rst rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/defaults/main.yml (97%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/handlers/main.yml (86%) create mode 100644 tripleo_ansible/roles/tripleo-ptp/meta/main.yml rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/molecule/default/Dockerfile (100%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/molecule/default/molecule.yml (100%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/molecule/default/playbook.yml (95%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/molecule/default/prepare.yml (100%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/molecule/ntp_stop/Dockerfile (100%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/molecule/ntp_stop/molecule.yml (100%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/molecule/ntp_stop/playbook.yml (96%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/molecule/ntp_stop/prepare.yml (100%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/tasks/main.yml (88%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/tasks/tripleo_ntp_stop.yml (100%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/tasks/tripleo_phc2sys.yml (100%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/tasks/tripleo_ptp.yml (100%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/templates/ptp4l.conf.j2 (100%) rename tripleo_ansible/roles/{tripleo-time => tripleo-ptp}/vars/redhat.yml (100%) create mode 100644 tripleo_ansible/roles/tripleo-timezone/defaults/main.yml create mode 100644 tripleo_ansible/roles/tripleo-timezone/handlers/main.yml rename tripleo_ansible/roles/{tripleo-time => tripleo-timezone}/meta/main.yml (95%) create mode 100644 tripleo_ansible/roles/tripleo-timezone/molecule/default/Dockerfile create mode 100644 tripleo_ansible/roles/tripleo-timezone/molecule/default/molecule.yml create mode 100644 tripleo_ansible/roles/tripleo-timezone/molecule/default/playbook.yml create mode 100644 tripleo_ansible/roles/tripleo-timezone/molecule/default/prepare.yml create mode 100644 tripleo_ansible/roles/tripleo-timezone/tasks/main.yml diff --git a/doc/source/roles/role-tripleo-time.rst b/doc/source/roles/role-tripleo-time.rst index e3053d7a0..51e52020d 100644 --- a/doc/source/roles/role-tripleo-time.rst +++ b/doc/source/roles/role-tripleo-time.rst @@ -1,6 +1,6 @@ -=================== -Role - tripleo-time -=================== +======================= +Role - tripleo-timezone +======================= .. ansibleautoplugin:: - :role: tripleo_ansible/roles/tripleo-time + :role: tripleo_ansible/roles/tripleo-timezone diff --git a/doc/source/roles/role-tripleo-timezone.rst b/doc/source/roles/role-tripleo-timezone.rst new file mode 100644 index 000000000..51e52020d --- /dev/null +++ b/doc/source/roles/role-tripleo-timezone.rst @@ -0,0 +1,6 @@ +======================= +Role - tripleo-timezone +======================= + +.. ansibleautoplugin:: + :role: tripleo_ansible/roles/tripleo-timezone diff --git a/tripleo_ansible/roles/tripleo-time/defaults/main.yml b/tripleo_ansible/roles/tripleo-ptp/defaults/main.yml similarity index 97% rename from tripleo_ansible/roles/tripleo-time/defaults/main.yml rename to tripleo_ansible/roles/tripleo-ptp/defaults/main.yml index 68cf77253..a086e920b 100644 --- a/tripleo_ansible/roles/tripleo-time/defaults/main.yml +++ b/tripleo_ansible/roles/tripleo-ptp/defaults/main.yml @@ -17,8 +17,6 @@ # All variables intended for modification should place placed in this file. -tripleo_timezone: 'UTC' - tripleo_ptp_slave_mode: 1 tripleo_ptp_interfaces: ["{{ ansible_default_ipv4.interface }}"] tripleo_ptp_transport: UDPv4 diff --git a/tripleo_ansible/roles/tripleo-time/handlers/main.yml b/tripleo_ansible/roles/tripleo-ptp/handlers/main.yml similarity index 86% rename from tripleo_ansible/roles/tripleo-time/handlers/main.yml rename to tripleo_ansible/roles/tripleo-ptp/handlers/main.yml index eca853f8b..3708bc7a4 100644 --- a/tripleo_ansible/roles/tripleo-time/handlers/main.yml +++ b/tripleo_ansible/roles/tripleo-ptp/handlers/main.yml @@ -25,11 +25,3 @@ name: phc2sys state: restarted enabled: true - -- name: Restart time services - service: - name: "{{ item }}" - state: restarted - with_items: - - rsyslog - - crond diff --git a/tripleo_ansible/roles/tripleo-ptp/meta/main.yml b/tripleo_ansible/roles/tripleo-ptp/meta/main.yml new file mode 100644 index 000000000..a5937b80d --- /dev/null +++ b/tripleo_ansible/roles/tripleo-ptp/meta/main.yml @@ -0,0 +1,45 @@ +--- +# Copyright 2019 Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +galaxy_info: + author: OpenStack + description: TripleO OpenStack Role -- tripleo-ptp + company: Red Hat + license: Apache-2.0 + min_ansible_version: 2.7 + # + # Provide a list of supported platforms, and for each platform a list of versions. + # If you don't wish to enumerate all versions for a particular platform, use 'all'. + # To view available platforms and versions (or releases), visit: + # https://galaxy.ansible.com/api/v1/platforms/ + # + platforms: + - name: Fedora + versions: + - 28 + - name: CentOS + versions: + - 7 + + galaxy_tags: + - tripleo + + +# List your role dependencies here, one per line. Be sure to remove the '[]' above, +# if you add dependencies to this list. +dependencies: + - role: tripleo-timezone diff --git a/tripleo_ansible/roles/tripleo-time/molecule/default/Dockerfile b/tripleo_ansible/roles/tripleo-ptp/molecule/default/Dockerfile similarity index 100% rename from tripleo_ansible/roles/tripleo-time/molecule/default/Dockerfile rename to tripleo_ansible/roles/tripleo-ptp/molecule/default/Dockerfile diff --git a/tripleo_ansible/roles/tripleo-time/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo-ptp/molecule/default/molecule.yml similarity index 100% rename from tripleo_ansible/roles/tripleo-time/molecule/default/molecule.yml rename to tripleo_ansible/roles/tripleo-ptp/molecule/default/molecule.yml diff --git a/tripleo_ansible/roles/tripleo-time/molecule/default/playbook.yml b/tripleo_ansible/roles/tripleo-ptp/molecule/default/playbook.yml similarity index 95% rename from tripleo_ansible/roles/tripleo-time/molecule/default/playbook.yml rename to tripleo_ansible/roles/tripleo-ptp/molecule/default/playbook.yml index 5bad75c09..7708044be 100644 --- a/tripleo_ansible/roles/tripleo-time/molecule/default/playbook.yml +++ b/tripleo_ansible/roles/tripleo-ptp/molecule/default/playbook.yml @@ -18,4 +18,4 @@ - name: Converge hosts: all roles: - - role: "tripleo-time" + - role: "tripleo-ptp" diff --git a/tripleo_ansible/roles/tripleo-time/molecule/default/prepare.yml b/tripleo_ansible/roles/tripleo-ptp/molecule/default/prepare.yml similarity index 100% rename from tripleo_ansible/roles/tripleo-time/molecule/default/prepare.yml rename to tripleo_ansible/roles/tripleo-ptp/molecule/default/prepare.yml diff --git a/tripleo_ansible/roles/tripleo-time/molecule/ntp_stop/Dockerfile b/tripleo_ansible/roles/tripleo-ptp/molecule/ntp_stop/Dockerfile similarity index 100% rename from tripleo_ansible/roles/tripleo-time/molecule/ntp_stop/Dockerfile rename to tripleo_ansible/roles/tripleo-ptp/molecule/ntp_stop/Dockerfile diff --git a/tripleo_ansible/roles/tripleo-time/molecule/ntp_stop/molecule.yml b/tripleo_ansible/roles/tripleo-ptp/molecule/ntp_stop/molecule.yml similarity index 100% rename from tripleo_ansible/roles/tripleo-time/molecule/ntp_stop/molecule.yml rename to tripleo_ansible/roles/tripleo-ptp/molecule/ntp_stop/molecule.yml diff --git a/tripleo_ansible/roles/tripleo-time/molecule/ntp_stop/playbook.yml b/tripleo_ansible/roles/tripleo-ptp/molecule/ntp_stop/playbook.yml similarity index 96% rename from tripleo_ansible/roles/tripleo-time/molecule/ntp_stop/playbook.yml rename to tripleo_ansible/roles/tripleo-ptp/molecule/ntp_stop/playbook.yml index 1b96acf4d..118b0b59e 100644 --- a/tripleo_ansible/roles/tripleo-time/molecule/ntp_stop/playbook.yml +++ b/tripleo_ansible/roles/tripleo-ptp/molecule/ntp_stop/playbook.yml @@ -20,5 +20,5 @@ tasks: - name: Run ntp stop include_role: - name: tripleo-time + name: tripleo-ptp tasks_from: tripleo_ntp_stop.yml diff --git a/tripleo_ansible/roles/tripleo-time/molecule/ntp_stop/prepare.yml b/tripleo_ansible/roles/tripleo-ptp/molecule/ntp_stop/prepare.yml similarity index 100% rename from tripleo_ansible/roles/tripleo-time/molecule/ntp_stop/prepare.yml rename to tripleo_ansible/roles/tripleo-ptp/molecule/ntp_stop/prepare.yml diff --git a/tripleo_ansible/roles/tripleo-time/tasks/main.yml b/tripleo_ansible/roles/tripleo-ptp/tasks/main.yml similarity index 88% rename from tripleo_ansible/roles/tripleo-time/tasks/main.yml rename to tripleo_ansible/roles/tripleo-ptp/tasks/main.yml index c91b43926..402cf9891 100644 --- a/tripleo_ansible/roles/tripleo-time/tasks/main.yml +++ b/tripleo_ansible/roles/tripleo-ptp/tasks/main.yml @@ -15,7 +15,7 @@ # under the License. -# "tripleo-time" will search for and load any operating system variable file +# "tripleo-ptp" will search for and load any operating system variable file # found within the "vars/" path. If no OS files are found the task will skip. - name: Gather variables for each operating system @@ -32,14 +32,11 @@ tags: - always -- name: Set timezone - timezone: - name: "{{ tripleo_timezone }}" - notify: - - Restart time services - - name: Run ptp tasks include_tasks: tripleo_ptp.yml - name: Run phc2sys tasks include_tasks: tripleo_phc2sys.yml + +- name: Force all notified handlers to run at this point + meta: flush_handlers diff --git a/tripleo_ansible/roles/tripleo-time/tasks/tripleo_ntp_stop.yml b/tripleo_ansible/roles/tripleo-ptp/tasks/tripleo_ntp_stop.yml similarity index 100% rename from tripleo_ansible/roles/tripleo-time/tasks/tripleo_ntp_stop.yml rename to tripleo_ansible/roles/tripleo-ptp/tasks/tripleo_ntp_stop.yml diff --git a/tripleo_ansible/roles/tripleo-time/tasks/tripleo_phc2sys.yml b/tripleo_ansible/roles/tripleo-ptp/tasks/tripleo_phc2sys.yml similarity index 100% rename from tripleo_ansible/roles/tripleo-time/tasks/tripleo_phc2sys.yml rename to tripleo_ansible/roles/tripleo-ptp/tasks/tripleo_phc2sys.yml diff --git a/tripleo_ansible/roles/tripleo-time/tasks/tripleo_ptp.yml b/tripleo_ansible/roles/tripleo-ptp/tasks/tripleo_ptp.yml similarity index 100% rename from tripleo_ansible/roles/tripleo-time/tasks/tripleo_ptp.yml rename to tripleo_ansible/roles/tripleo-ptp/tasks/tripleo_ptp.yml diff --git a/tripleo_ansible/roles/tripleo-time/templates/ptp4l.conf.j2 b/tripleo_ansible/roles/tripleo-ptp/templates/ptp4l.conf.j2 similarity index 100% rename from tripleo_ansible/roles/tripleo-time/templates/ptp4l.conf.j2 rename to tripleo_ansible/roles/tripleo-ptp/templates/ptp4l.conf.j2 diff --git a/tripleo_ansible/roles/tripleo-time/vars/redhat.yml b/tripleo_ansible/roles/tripleo-ptp/vars/redhat.yml similarity index 100% rename from tripleo_ansible/roles/tripleo-time/vars/redhat.yml rename to tripleo_ansible/roles/tripleo-ptp/vars/redhat.yml diff --git a/tripleo_ansible/roles/tripleo-timezone/defaults/main.yml b/tripleo_ansible/roles/tripleo-timezone/defaults/main.yml new file mode 100644 index 000000000..bb9b73912 --- /dev/null +++ b/tripleo_ansible/roles/tripleo-timezone/defaults/main.yml @@ -0,0 +1,20 @@ +--- +# Copyright 2019 Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +# All variables intended for modification should place placed in this file. + +tripleo_timezone: 'UTC' diff --git a/tripleo_ansible/roles/tripleo-timezone/handlers/main.yml b/tripleo_ansible/roles/tripleo-timezone/handlers/main.yml new file mode 100644 index 000000000..24b875cb8 --- /dev/null +++ b/tripleo_ansible/roles/tripleo-timezone/handlers/main.yml @@ -0,0 +1,24 @@ +--- +# Copyright 2019 Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +- name: Restart time services + systemd: + name: "{{ item }}" + state: restarted + with_items: + - rsyslog + - crond diff --git a/tripleo_ansible/roles/tripleo-time/meta/main.yml b/tripleo_ansible/roles/tripleo-timezone/meta/main.yml similarity index 95% rename from tripleo_ansible/roles/tripleo-time/meta/main.yml rename to tripleo_ansible/roles/tripleo-timezone/meta/main.yml index 41b1cdaca..8f09752c7 100644 --- a/tripleo_ansible/roles/tripleo-time/meta/main.yml +++ b/tripleo_ansible/roles/tripleo-timezone/meta/main.yml @@ -17,7 +17,7 @@ galaxy_info: author: OpenStack - description: TripleO OpenStack Role -- tripleo-time + description: TripleO OpenStack Role -- tripleo-timezone company: Red Hat license: Apache-2.0 min_ansible_version: 2.7 diff --git a/tripleo_ansible/roles/tripleo-timezone/molecule/default/Dockerfile b/tripleo_ansible/roles/tripleo-timezone/molecule/default/Dockerfile new file mode 100644 index 000000000..1b91a0e0b --- /dev/null +++ b/tripleo_ansible/roles/tripleo-timezone/molecule/default/Dockerfile @@ -0,0 +1,37 @@ +# Molecule managed +# Copyright 2019 Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +{% if item.registry is defined %} +FROM {{ item.registry.url }}/{{ item.image }} +{% else %} +FROM {{ item.image }} +{% endif %} + +RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \ + elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash {{ item.pkg_extras | default('') }} && dnf clean all; \ + elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl python-setuptools bash {{ item.pkg_extras | default('') }} && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ + elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml {{ item.pkg_extras | default('') }} && zypper clean -a; \ + elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates {{ item.pkg_extras | default('') }}; \ + elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates {{ item.pkg_extras | default('') }} && xbps-remove -O; fi + +{% for pkg in item.easy_install | default([]) %} +# install pip for centos where there is no python-pip rpm in default repos +RUN easy_install {{ pkg }} +{% endfor %} + + +CMD ["sh", "-c", "while true; do sleep 10000; done"] diff --git a/tripleo_ansible/roles/tripleo-timezone/molecule/default/molecule.yml b/tripleo_ansible/roles/tripleo-timezone/molecule/default/molecule.yml new file mode 100644 index 000000000..d808d17ff --- /dev/null +++ b/tripleo_ansible/roles/tripleo-timezone/molecule/default/molecule.yml @@ -0,0 +1,68 @@ +--- +driver: + name: docker + +log: true + +platforms: + - name: centos7 + hostname: centos7 + image: centos:7 + dockerfile: Dockerfile + pkg_extras: python-setuptools cronie rsyslog + easy_install: + - pip + environment: &env + http_proxy: "{{ lookup('env', 'http_proxy') }}" + https_proxy: "{{ lookup('env', 'https_proxy') }}" + command: /sbin/init + tmpfs: + - /run + - /tmp + capabilities: + - ALL # CENT7 requires all due to the age of the software + volumes: + - /run/udev:/run/udev:ro + - /sys/fs/cgroup:/sys/fs/cgroup:ro + + - name: fedora28 + hostname: fedora28 + image: fedora:28 + dockerfile: Dockerfile + pkg_extras: python*-setuptools cronie rsyslog + environment: + http_proxy: "{{ lookup('env', 'http_proxy') }}" + https_proxy: "{{ lookup('env', 'https_proxy') }}" + command: /sbin/init + privileged: true + tmpfs: + - /run + - /tmp + capabilities: + - SYS_ADMIN + volumes: + - /run/udev:/run/udev:ro + - /sys/fs/cgroup:/sys/fs/cgroup:ro + +provisioner: + name: ansible + log: true + env: + ANSIBLE_STDOUT_CALLBACK: yaml + +scenario: + test_sequence: + - destroy + - create + - prepare + - converge + - verify + - destroy + +lint: + enabled: false + +verifier: + name: testinfra + lint: + name: flake8 diff --git a/tripleo_ansible/roles/tripleo-timezone/molecule/default/playbook.yml b/tripleo_ansible/roles/tripleo-timezone/molecule/default/playbook.yml new file mode 100644 index 000000000..11dc3748e --- /dev/null +++ b/tripleo_ansible/roles/tripleo-timezone/molecule/default/playbook.yml @@ -0,0 +1,21 @@ +--- +# Copyright 2019 Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +- name: Converge + hosts: all + roles: + - role: "tripleo-timezone" diff --git a/tripleo_ansible/roles/tripleo-timezone/molecule/default/prepare.yml b/tripleo_ansible/roles/tripleo-timezone/molecule/default/prepare.yml new file mode 100644 index 000000000..ef85c3128 --- /dev/null +++ b/tripleo_ansible/roles/tripleo-timezone/molecule/default/prepare.yml @@ -0,0 +1,21 @@ +--- +# Copyright 2019 Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +- name: Prepare + hosts: all + roles: + - role: test_deps diff --git a/tripleo_ansible/roles/tripleo-timezone/tasks/main.yml b/tripleo_ansible/roles/tripleo-timezone/tasks/main.yml new file mode 100644 index 000000000..c493f5214 --- /dev/null +++ b/tripleo_ansible/roles/tripleo-timezone/tasks/main.yml @@ -0,0 +1,27 @@ +--- +# Copyright 2019 Red Hat, Inc. +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +# "tripleo-timezone" will search for and load any operating system variable file + +- name: Set timezone + timezone: + name: "{{ tripleo_timezone }}" + notify: + - Restart time services + +- name: Force all notified handlers to run at this point + meta: flush_handlers diff --git a/zuul.d/molecule.yaml b/zuul.d/molecule.yaml index 6d93f5e21..cc5c5b501 100644 --- a/zuul.d/molecule.yaml +++ b/zuul.d/molecule.yaml @@ -20,7 +20,8 @@ - tripleo-ansible-centos-7-molecule-tripleo-persist - tripleo-ansible-centos-7-molecule-tripleo-ceph-run-ansible - tripleo-ansible-centos-7-molecule-login-defs - - tripleo-ansible-centos-7-molecule-tripleo-time + - tripleo-ansible-centos-7-molecule-tripleo-ptp + - tripleo-ansible-centos-7-molecule-tripleo-timezone - tripleo-ansible-centos-7-molecule-tripleo-config gate: jobs: @@ -42,7 +43,8 @@ - tripleo-ansible-centos-7-molecule-tripleo-persist - tripleo-ansible-centos-7-molecule-tripleo-ceph-run-ansible - tripleo-ansible-centos-7-molecule-login-defs - - tripleo-ansible-centos-7-molecule-tripleo-time + - tripleo-ansible-centos-7-molecule-tripleo-ptp + - tripleo-ansible-centos-7-molecule-tripleo-timezone - tripleo-ansible-centos-7-molecule-tripleo-config name: tripleo-ansible-molecule-jobs - job: @@ -168,8 +170,8 @@ name: tripleo-ansible-centos-7-molecule-tripleo-ceph-run-ansible parent: tripleo-ansible-centos-7-base vars: + tripleo_job_ansible_args: -v --skip-tags=run_uuid_ansible,run_ceph_ansible tripleo_role_name: tripleo-ceph-run-ansible - tripleo_job_ansible_args: '-v --skip-tags=run_uuid_ansible,run_ceph_ansible' - job: files: - ^tripleo_ansible/roles/login-defs/.* @@ -179,11 +181,18 @@ tripleo_role_name: login-defs - job: files: - - ^tripleo_ansible/roles/tripleo-time/.* - name: tripleo-ansible-centos-7-molecule-tripleo-time + - ^tripleo_ansible/roles/tripleo-ptp/.* + name: tripleo-ansible-centos-7-molecule-tripleo-ptp parent: tripleo-ansible-centos-7-base vars: - tripleo_role_name: tripleo-time + tripleo_role_name: tripleo-ptp +- job: + files: + - ^tripleo_ansible/roles/tripleo-timezone/.* + name: tripleo-ansible-centos-7-molecule-tripleo-timezone + parent: tripleo-ansible-centos-7-base + vars: + tripleo_role_name: tripleo-timezone - job: files: - ^tripleo_ansible/roles/tripleo-config/.*