diff --git a/ansible/roles/kolla-openstack/defaults/main.yml b/ansible/roles/kolla-openstack/defaults/main.yml index 63b7856c1..65a9dd800 100644 --- a/ansible/roles/kolla-openstack/defaults/main.yml +++ b/ansible/roles/kolla-openstack/defaults/main.yml @@ -156,6 +156,10 @@ kolla_openstack_custom_config_include_globs_default: glob: swift/** - enabled: '{{ kolla_enable_telegraf | bool }}' glob: telegraf/** + - enabled: '{{ kolla_enable_watcher | bool }}' + glob: watcher.conf + - enabled: '{{ kolla_enable_watcher | bool }}' + glob: watcher/** # Extra items to add to kolla_openstack_custom_config_include_globs_default # to produce kolla_openstack_custom_config_include_globs. @@ -817,3 +821,9 @@ kolla_enable_swift: false # Whether to enable telegraf kolla_enable_telegraf: true + +############################################################################### +# Watcher configuration. + +# Whether to enable watcher +kolla_enable_watcher: false diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml index 345cc4eef..8877c67ec 100644 --- a/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml +++ b/ansible/roles/kolla-openstack/molecule/enable-everything/molecule.yml @@ -140,6 +140,7 @@ provisioner: kolla_enable_prometheus: true kolla_enable_swift: true kolla_enable_telegraf: true + kolla_enable_watcher: true lint: name: ansible-lint scenario: diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/prepare.yml b/ansible/roles/kolla-openstack/molecule/enable-everything/prepare.yml index 3c491fa1e..73cdc17c0 100644 --- a/ansible/roles/kolla-openstack/molecule/enable-everything/prepare.yml +++ b/ansible/roles/kolla-openstack/molecule/enable-everything/prepare.yml @@ -40,6 +40,7 @@ - prometheus/prometheus.yml.d # Example of non-ini files that should be templated but not merged - fluentd/input/ + - watcher - name: Ensure extra INI configuration files exist copy: @@ -75,6 +76,7 @@ - nova.conf - octavia.conf - placement.conf + - watcher.conf - name: Ensure extra YAML configuration files exist copy: @@ -114,6 +116,10 @@ format1 /^(?\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}) \[(?\w+)\] (?.*)/ + - dest: watcher/policy.yaml + content: | + --- + "my_custom_rule": "role:custom_role" loop_control: label: "{{ item.dest }}" diff --git a/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py b/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py index 4e9a40a22..356252bdb 100644 --- a/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py +++ b/ansible/roles/kolla-openstack/molecule/enable-everything/tests/test_default.py @@ -80,6 +80,7 @@ def test_service_ini_file(host, path): 'nova.conf', 'octavia.conf', 'placement.conf', + 'watcher.conf', 'backup.my.cnf']) def test_service_ini_file_extra_confs(host, path): # Tests config added via extra config files @@ -94,7 +95,8 @@ def test_service_ini_file_extra_confs(host, path): 'ironic/ironic-agent.kernel', 'nova/nova-libvirt/cacert.pem', 'nova/nova-libvirt/clientcert.pem', - 'nova/nova-libvirt/clientkey.pem']) + 'nova/nova-libvirt/clientkey.pem', + 'watcher/policy.yaml']) def test_service_non_ini_file(host, path): # TODO(mgoddard): Check config file contents. path = os.path.join('/etc/kolla/config', path) diff --git a/doc/source/configuration/reference/kolla-ansible.rst b/doc/source/configuration/reference/kolla-ansible.rst index be35761a3..14cd7b6a2 100644 --- a/doc/source/configuration/reference/kolla-ansible.rst +++ b/doc/source/configuration/reference/kolla-ansible.rst @@ -749,6 +749,8 @@ which files are supported. ``prometheus/*`` Prometheus configuration. ``swift/*`` Extended swift configuration. ``telegraf/*`` Extended Telegraf configuration. + ``watcher.conf`` Watcher configuration. + ``watcher/*`` Extended Watcher configuration. =============================== ======================================================= Configuring an OpenStack Component diff --git a/releasenotes/notes/add-support-for-watcher-custom-config-files-01ebecc4feb232db.yaml b/releasenotes/notes/add-support-for-watcher-custom-config-files-01ebecc4feb232db.yaml new file mode 100644 index 000000000..2f8fa291a --- /dev/null +++ b/releasenotes/notes/add-support-for-watcher-custom-config-files-01ebecc4feb232db.yaml @@ -0,0 +1,4 @@ +--- +features: + - Adds support for custom Watcher configuration via ``watcher.conf`` and + ``watcher/*`` files.