diff --git a/docs/README.rst b/docs/README.rst index 1183c65..347f444 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -129,28 +129,6 @@ dependency on ``nsd.service.clean`` via include list. This state will remove the nsd package and has a depency on ``nsd.config.clean`` via include list. -``nsd.subcomponent`` -^^^^^^^^^^^^^^^^^^^^^^^^^ - -*Meta-state (This is a state that includes other states)*. - -This state installs a subcomponent configuration file before -configuring and starting the nsd service. - -``nsd.subcomponent.config`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -This state will configure the nsd subcomponent and has a -dependency on ``nsd.config`` via include list. - -``nsd.subcomponent.config.clean`` -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -This state will remove the configuration of the nsd subcomponent -and reload the nsd service by a dependency on -``nsd.service.running`` via include list and ``watch_in`` -requisite. - Testing ------- diff --git a/nsd/clean.sls b/nsd/clean.sls index 9e45fb4..2cefe7d 100644 --- a/nsd/clean.sls +++ b/nsd/clean.sls @@ -2,7 +2,6 @@ # vim: ft=sls include: - - .subcomponent.clean - .service.clean - .config.clean - .package.clean diff --git a/nsd/init.sls b/nsd/init.sls index 275d1fc..858a8e6 100644 --- a/nsd/init.sls +++ b/nsd/init.sls @@ -5,4 +5,3 @@ include: - .package - .config - .service - - .subcomponent diff --git a/nsd/parameters/defaults.yaml b/nsd/parameters/defaults.yaml index 4b45194..04325df 100644 --- a/nsd/parameters/defaults.yaml +++ b/nsd/parameters/defaults.yaml @@ -10,8 +10,6 @@ values: config: '/etc/nsd' service: name: nsd - subcomponent: - config: '/etc/nsd-subcomponent-formula.conf' # Just here for testing added_in_defaults: defaults_value winner: defaults diff --git a/nsd/subcomponent/clean.sls b/nsd/subcomponent/clean.sls deleted file mode 100644 index 564769d..0000000 --- a/nsd/subcomponent/clean.sls +++ /dev/null @@ -1,5 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=sls - -include: - - .config.clean diff --git a/nsd/subcomponent/config/clean.sls b/nsd/subcomponent/config/clean.sls deleted file mode 100644 index aa81bbf..0000000 --- a/nsd/subcomponent/config/clean.sls +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=sls - -{#- Get the `tplroot` from `tpldir` #} -{%- set tplroot = tpldir.split('/')[0] %} -{%- set sls_service_clean = tplroot ~ '.service.clean' %} -{%- from tplroot ~ "/map.jinja" import mapdata as nsd with context %} - -include: - - {{ sls_service_clean }} - -nsd-subcomponent-config-clean-file-absent: - file.absent: - - name: {{ nsd.subcomponent.config }} - - watch_in: - - sls: {{ sls_service_clean }} diff --git a/nsd/subcomponent/config/file.sls b/nsd/subcomponent/config/file.sls deleted file mode 100644 index 4cf0041..0000000 --- a/nsd/subcomponent/config/file.sls +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=sls - -{#- Get the `tplroot` from `tpldir` #} -{%- set tplroot = tpldir.split('/')[0] %} -{%- set sls_config_file = tplroot ~ '.config.file' %} -{%- from tplroot ~ "/map.jinja" import mapdata as nsd with context %} -{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} - -include: - - {{ sls_config_file }} - -nsd-subcomponent-config-file-file-managed: - file.managed: - - name: {{ nsd.subcomponent.config }} - - source: {{ files_switch(['subcomponent-example.tmpl'], - lookup='nsd-subcomponent-config-file-file-managed', - use_subpath=True - ) - }} - - mode: 644 - - user: root - - group: {{ nsd.rootgroup }} - - makedirs: True - - template: jinja - - require_in: - - sls: {{ sls_config_file }} diff --git a/nsd/subcomponent/config/files/default/subcomponent-example.tmpl b/nsd/subcomponent/config/files/default/subcomponent-example.tmpl deleted file mode 100644 index 522de00..0000000 --- a/nsd/subcomponent/config/files/default/subcomponent-example.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -######################################################################## -# File managed by Salt at <{{ source }}>. -# Your changes will be overwritten. -######################################################################## - -This is a subcomponent example file from SaltStack template-formula. diff --git a/nsd/subcomponent/config/files/default/subcomponent-example.tmpl.jinja b/nsd/subcomponent/config/files/default/subcomponent-example.tmpl.jinja deleted file mode 100644 index cbfd51d..0000000 --- a/nsd/subcomponent/config/files/default/subcomponent-example.tmpl.jinja +++ /dev/null @@ -1,6 +0,0 @@ -######################################################################## -# File managed by Salt at <{{ source }}>. -# Your changes will be overwritten. -######################################################################## - -This is another subcomponent example file from SaltStack template-formula. diff --git a/nsd/subcomponent/config/init.sls b/nsd/subcomponent/config/init.sls deleted file mode 100644 index 465ddfe..0000000 --- a/nsd/subcomponent/config/init.sls +++ /dev/null @@ -1,5 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=sls - -include: - - .file diff --git a/nsd/subcomponent/init.sls b/nsd/subcomponent/init.sls deleted file mode 100644 index 6003be1..0000000 --- a/nsd/subcomponent/init.sls +++ /dev/null @@ -1,5 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: ft=sls - -include: - - .config diff --git a/pillar.example b/pillar.example index 91f2070..ba4c908 100644 --- a/pillar.example +++ b/pillar.example @@ -49,8 +49,6 @@ nsd: source_files: nsd-config-file-file-managed: - 'example.tmpl.jinja' - nsd-subcomponent-config-file-file-managed: - - 'subcomponent-example.tmpl.jinja' # Just for testing purposes winner: pillar diff --git a/test/integration/default/controls/config.rb b/test/integration/default/controls/config.rb index 5f8b566..1f6b0e4 100644 --- a/test/integration/default/controls/config.rb +++ b/test/integration/default/controls/config.rb @@ -26,9 +26,7 @@ control 'nsd.config.file' do should include( '"tofs": {"files_switch": ["any/path/can/be/used/here", "id", '\ '"roles", "osfinger", "os", "os_family"], "source_files": '\ - '{"nsd-config-file-file-managed": ["example.tmpl.jinja"], '\ - '"nsd-subcomponent-config-file-file-managed": '\ - '["subcomponent-example.tmpl.jinja"]}' + '{"nsd-config-file-file-managed": ["example.tmpl.jinja"]}' ) # rubocop:enable Layout/LineLength # rubocop:enable Lint/RedundantCopDisableDirective diff --git a/test/integration/default/controls/subcomponent_config.rb b/test/integration/default/controls/subcomponent_config.rb deleted file mode 100644 index eef0281..0000000 --- a/test/integration/default/controls/subcomponent_config.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -control 'nsd.subcomponent.config.file' do - title 'Verify the subcomponent configuration file' - - describe file('/etc/nsd-subcomponent-formula.conf') do - it { should be_file } - it { should be_owned_by 'root' } - it { should be_grouped_into 'root' } - its('mode') { should cmp '0644' } - its('content') do - should include( - '# File managed by Salt at '\ - '.' - ) - end - its('content') do - should include( - 'This is another subcomponent example file from SaltStack '\ - 'template-formula.' - ) - end - end -end diff --git a/test/integration/default/files/_mapdata/amazonlinux-1.yaml b/test/integration/default/files/_mapdata/amazonlinux-1.yaml index 2bd13f8..9446fe4 100644 --- a/test/integration/default/files/_mapdata/amazonlinux-1.yaml +++ b/test/integration/default/files/_mapdata/amazonlinux-1.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: crond - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/amazonlinux-2.yaml b/test/integration/default/files/_mapdata/amazonlinux-2.yaml index df4fd6e..9695c83 100644 --- a/test/integration/default/files/_mapdata/amazonlinux-2.yaml +++ b/test/integration/default/files/_mapdata/amazonlinux-2.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/arch-base-latest.yaml b/test/integration/default/files/_mapdata/arch-base-latest.yaml index 84bdd41..eb05967 100644 --- a/test/integration/default/files/_mapdata/arch-base-latest.yaml +++ b/test/integration/default/files/_mapdata/arch-base-latest.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/centos-6.yaml b/test/integration/default/files/_mapdata/centos-6.yaml index 699ead8..41a4d04 100644 --- a/test/integration/default/files/_mapdata/centos-6.yaml +++ b/test/integration/default/files/_mapdata/centos-6.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: crond - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/centos-7.yaml b/test/integration/default/files/_mapdata/centos-7.yaml index 0f8ccc8..b097247 100644 --- a/test/integration/default/files/_mapdata/centos-7.yaml +++ b/test/integration/default/files/_mapdata/centos-7.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/centos-8.yaml b/test/integration/default/files/_mapdata/centos-8.yaml index d40f5ec..578a0a6 100644 --- a/test/integration/default/files/_mapdata/centos-8.yaml +++ b/test/integration/default/files/_mapdata/centos-8.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/debian-10.yaml b/test/integration/default/files/_mapdata/debian-10.yaml index 2f27c32..e90b014 100644 --- a/test/integration/default/files/_mapdata/debian-10.yaml +++ b/test/integration/default/files/_mapdata/debian-10.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/debian-9.yaml b/test/integration/default/files/_mapdata/debian-9.yaml index f005cf8..041e4dc 100644 --- a/test/integration/default/files/_mapdata/debian-9.yaml +++ b/test/integration/default/files/_mapdata/debian-9.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/fedora-31.yaml b/test/integration/default/files/_mapdata/fedora-31.yaml index 30bd031..2b73533 100644 --- a/test/integration/default/files/_mapdata/fedora-31.yaml +++ b/test/integration/default/files/_mapdata/fedora-31.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/fedora-32.yaml b/test/integration/default/files/_mapdata/fedora-32.yaml index 7445036..b3b4061 100644 --- a/test/integration/default/files/_mapdata/fedora-32.yaml +++ b/test/integration/default/files/_mapdata/fedora-32.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/fedora-33.yaml b/test/integration/default/files/_mapdata/fedora-33.yaml index 6ecc6fa..1af96df 100644 --- a/test/integration/default/files/_mapdata/fedora-33.yaml +++ b/test/integration/default/files/_mapdata/fedora-33.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/gentoo-2-sysd.yaml b/test/integration/default/files/_mapdata/gentoo-2-sysd.yaml index 8e5caf9..6da7b6d 100644 --- a/test/integration/default/files/_mapdata/gentoo-2-sysd.yaml +++ b/test/integration/default/files/_mapdata/gentoo-2-sysd.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/gentoo-2-sysv.yaml b/test/integration/default/files/_mapdata/gentoo-2-sysv.yaml index d92e975..b95640e 100644 --- a/test/integration/default/files/_mapdata/gentoo-2-sysv.yaml +++ b/test/integration/default/files/_mapdata/gentoo-2-sysv.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: mtab - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/opensuse-15.yaml b/test/integration/default/files/_mapdata/opensuse-15.yaml index 1bb2479..c5dd6fd 100644 --- a/test/integration/default/files/_mapdata/opensuse-15.yaml +++ b/test/integration/default/files/_mapdata/opensuse-15.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml b/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml index 552331a..457c2c4 100644 --- a/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml +++ b/test/integration/default/files/_mapdata/opensuse-tumbleweed.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/oraclelinux-7.yaml b/test/integration/default/files/_mapdata/oraclelinux-7.yaml index 2b9e68f..3b6a365 100644 --- a/test/integration/default/files/_mapdata/oraclelinux-7.yaml +++ b/test/integration/default/files/_mapdata/oraclelinux-7.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/oraclelinux-8.yaml b/test/integration/default/files/_mapdata/oraclelinux-8.yaml index a04c318..3e32b57 100644 --- a/test/integration/default/files/_mapdata/oraclelinux-8.yaml +++ b/test/integration/default/files/_mapdata/oraclelinux-8.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/ubuntu-16.yaml b/test/integration/default/files/_mapdata/ubuntu-16.yaml index 9e14f8f..06ea8c5 100644 --- a/test/integration/default/files/_mapdata/ubuntu-16.yaml +++ b/test/integration/default/files/_mapdata/ubuntu-16.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/ubuntu-18.yaml b/test/integration/default/files/_mapdata/ubuntu-18.yaml index 602414f..bcd02c7 100644 --- a/test/integration/default/files/_mapdata/ubuntu-18.yaml +++ b/test/integration/default/files/_mapdata/ubuntu-18.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/integration/default/files/_mapdata/ubuntu-20.yaml b/test/integration/default/files/_mapdata/ubuntu-20.yaml index 700ee66..38fd30a 100644 --- a/test/integration/default/files/_mapdata/ubuntu-20.yaml +++ b/test/integration/default/files/_mapdata/ubuntu-20.yaml @@ -26,8 +26,6 @@ values: rootgroup: root service: name: systemd-journald - subcomponent: - config: /etc/nsd-subcomponent-formula.conf tofs: files_switch: - any/path/can/be/used/here @@ -39,6 +37,4 @@ values: source_files: nsd-config-file-file-managed: - example.tmpl.jinja - nsd-subcomponent-config-file-file-managed: - - subcomponent-example.tmpl.jinja winner: pillar diff --git a/test/salt/pillar/upstart.sls b/test/salt/pillar/upstart.sls index d7530c7..abe37c2 100644 --- a/test/salt/pillar/upstart.sls +++ b/test/salt/pillar/upstart.sls @@ -47,8 +47,6 @@ nsd: source_files: nsd-config-file-file-managed: - 'example.tmpl.jinja' - nsd-subcomponent-config-file-file-managed: - - 'subcomponent-example.tmpl.jinja' # Just for testing purposes winner: pillar