Merge "Disable cloud launcher cron job during CI"
This commit is contained in:
commit
1ee1e73c48
@ -19,3 +19,10 @@ bridge.o.o and all hosts.
|
|||||||
|
|
||||||
.. zuul:rolevar:: weekday
|
.. zuul:rolevar:: weekday
|
||||||
:default: *
|
:default: *
|
||||||
|
|
||||||
|
.. zuul:rolevar:: ansible_cron_disable_job
|
||||||
|
:default: false
|
||||||
|
|
||||||
|
Disabled installed cron job. This is only useful for CI jobs
|
||||||
|
testing bridge.o.o so that the test host does not randomly run
|
||||||
|
the script during CI tests that fall during the interval.
|
||||||
|
@ -5,4 +5,4 @@ update_cron_interval:
|
|||||||
month: '*'
|
month: '*'
|
||||||
weekday: '*'
|
weekday: '*'
|
||||||
# Flag that can be set in tests to ensure cron is not run
|
# Flag that can be set in tests to ensure cron is not run
|
||||||
ansible_cron_install_cron: true
|
ansible_cron_disable_job: false
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
cron:
|
cron:
|
||||||
name: run_all.sh
|
name: run_all.sh
|
||||||
state: present
|
state: present
|
||||||
|
disabled: "{{ ansible_cron_disable_job }}"
|
||||||
# Note /var/run is ephemeral; so after a reboot we need to
|
# Note /var/run is ephemeral; so after a reboot we need to
|
||||||
# ensure the lockfile dir is there before we run...
|
# ensure the lockfile dir is there before we run...
|
||||||
job: 'mkdir -p /var/run/ansible; flock -n /var/run/ansible/run_all.lock bash /opt/system-config/run_all.sh -c >> /var/log/ansible/run_all_cron.log 2>&1'
|
job: 'mkdir -p /var/run/ansible; flock -n /var/run/ansible/run_all.lock bash /opt/system-config/run_all.sh -c >> /var/log/ansible/run_all_cron.log 2>&1'
|
||||||
@ -21,7 +22,6 @@
|
|||||||
day: "{{ update_cron_interval.day }}"
|
day: "{{ update_cron_interval.day }}"
|
||||||
month: "{{ update_cron_interval.month }}"
|
month: "{{ update_cron_interval.month }}"
|
||||||
weekday: "{{ update_cron_interval.weekday }}"
|
weekday: "{{ update_cron_interval.weekday }}"
|
||||||
when: ansible_cron_install_cron
|
|
||||||
|
|
||||||
- name: Setup log rotation
|
- name: Setup log rotation
|
||||||
include_role:
|
include_role:
|
||||||
|
@ -24,3 +24,10 @@ with.
|
|||||||
|
|
||||||
.. zuul:rolevar:: weekday
|
.. zuul:rolevar:: weekday
|
||||||
:default: *
|
:default: *
|
||||||
|
|
||||||
|
.. zuul:rolevar:: cloud_launcher_disable_job
|
||||||
|
:default: false
|
||||||
|
|
||||||
|
Prevent installation of cron job. This is only useful for CI
|
||||||
|
jobs testing bridge.o.o so that the test host does not randomly
|
||||||
|
run the script during CI tests that fall during the interval.
|
||||||
|
@ -4,3 +4,4 @@ cloud_launcher_cron_interval:
|
|||||||
day: '*'
|
day: '*'
|
||||||
month: '*'
|
month: '*'
|
||||||
weekday: '*'
|
weekday: '*'
|
||||||
|
cloud_launcher_disable_job: false
|
@ -7,6 +7,7 @@
|
|||||||
cron:
|
cron:
|
||||||
name: run_cloud_launcher.sh
|
name: run_cloud_launcher.sh
|
||||||
state: present
|
state: present
|
||||||
|
disabled: "{{ cloud_launcher_disable_job }}"
|
||||||
job: '/usr/bin/flock -n /var/run/ansible/run_cloud_launcher.lock /bin/bash /opt/system-config/run_cloud_launcher.sh -c >> /var/log/ansible/run_cloud_launcher_cron.log 2>&1'
|
job: '/usr/bin/flock -n /var/run/ansible/run_cloud_launcher.lock /bin/bash /opt/system-config/run_cloud_launcher.sh -c >> /var/log/ansible/run_cloud_launcher_cron.log 2>&1'
|
||||||
minute: "{{ cloud_launcher_cron_interval.minute }}"
|
minute: "{{ cloud_launcher_cron_interval.minute }}"
|
||||||
hour: "{{ cloud_launcher_cron_interval.hour }}"
|
hour: "{{ cloud_launcher_cron_interval.hour }}"
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
- import_playbook: ../bridge.yaml
|
- import_playbook: ../bridge.yaml
|
||||||
vars:
|
vars:
|
||||||
root_rsa_key: "{{ lookup('file', zuul.executor.work_root + '/' + zuul.build + '_id_rsa') }}"
|
root_rsa_key: "{{ lookup('file', zuul.executor.work_root + '/' + zuul.build + '_id_rsa') }}"
|
||||||
ansible_cron_install_cron: false
|
ansible_cron_disable_job: true
|
||||||
|
cloud_launcher_disable_job: true
|
||||||
|
|
||||||
- hosts: bridge.openstack.org
|
- hosts: bridge.openstack.org
|
||||||
become: true
|
become: true
|
||||||
|
@ -65,4 +65,6 @@ clouds:
|
|||||||
openstackzuul_fortnebula_password: password
|
openstackzuul_fortnebula_password: password
|
||||||
openstackzuul_fortnebula_project_name: project
|
openstackzuul_fortnebula_project_name: project
|
||||||
gitea_kube_key: Z2l0ZWFfazhzX2tleQ==
|
gitea_kube_key: Z2l0ZWFfazhzX2tleQ==
|
||||||
ansible_cron_install_cron: false
|
|
||||||
|
ansible_cron_disable_job: true
|
||||||
|
cloud_launcher_disable_job: true
|
||||||
|
@ -45,6 +45,12 @@ def test_openstacksdk_config(host):
|
|||||||
assert f.mode == 0o640
|
assert f.mode == 0o640
|
||||||
|
|
||||||
|
|
||||||
|
def test_ansible_run_all_cron(host):
|
||||||
|
with host.sudo():
|
||||||
|
crontab = host.check_output('crontab -l')
|
||||||
|
assert 'run_all.sh' in crontab
|
||||||
|
|
||||||
|
|
||||||
def test_cloud_launcher_cron(host):
|
def test_cloud_launcher_cron(host):
|
||||||
with host.sudo():
|
with host.sudo():
|
||||||
crontab = host.check_output('crontab -l')
|
crontab = host.check_output('crontab -l')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user