From d9623660a2b3f41d113c22f3723ff264c6a76f28 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Tue, 10 Jan 2023 10:57:39 +0100 Subject: [PATCH 01/27] Nats-server data --- data/nats-server/default.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/data/nats-server/default.yaml b/data/nats-server/default.yaml index 4530a941..3b4faeb5 100644 --- a/data/nats-server/default.yaml +++ b/data/nats-server/default.yaml @@ -9,9 +9,15 @@ nats-server::settings: process_user: 'root' process_group: 'root' config_file_path: '/etc/nats/nats-server.conf' - config_dir_path: '/etc/nats' + pid_file_path: '/run/nats-server.pid' + init_file_path: '/etc/sysconfig/nats-server.conf' + log_file_path: + - '/var/log/nats-server/nats-server.log' + config_dir_path: '/etc/nats-server' + log_dir_path: + - '/var/log/nats-server' - # tp 4 settings +# tp 4 settings install_method: 'file' description: 'NATS is an open-source, high-performance, cloud native messaging system.' docker_image: 'nats' @@ -59,6 +65,8 @@ nats-server::settings: command: 'GO111MODULE=on go get github.com/nats-io/nats-server/v2' releases: + base_url: 'https://github.com/nats-io/nats-server/releases/download/' + file_format: zip latest_version: '2.9.11' prerequisites: {} base_url: 'https://github.com/nats-io/nats-server/releases/download/v$VERSION' From 7ff5b63ffd30cc024d6155e0f16bcfb1a87a25b1 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Tue, 10 Jan 2023 11:19:28 +0100 Subject: [PATCH 02/27] Nuclei tinydata --- data/nuclei/default.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/nuclei/default.yaml b/data/nuclei/default.yaml index f5f77628..76d67bbe 100644 --- a/data/nuclei/default.yaml +++ b/data/nuclei/default.yaml @@ -9,7 +9,7 @@ nuclei::settings: validate_cmd: 'nuclei' config_dir_path: '$HOME/.config/nuclei' - # tp 4 settings +# tp 4 settings install_method: 'file' description: 'Fast and customizable vulnerability scanner based on simple YAML based DSL.' docker_image: 'projectdiscovery/nuclei' From ae37d18c697c7ae5d067a4b9c5fba29535517ba9 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Tue, 10 Jan 2023 11:19:42 +0100 Subject: [PATCH 03/27] Docker on new OSes --- data/docker/upstream/osfamily/windows.yaml | 1 - data/nats-server/default.yaml | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/data/docker/upstream/osfamily/windows.yaml b/data/docker/upstream/osfamily/windows.yaml index 4ea34537..f2eb5d9b 100644 --- a/data/docker/upstream/osfamily/windows.yaml +++ b/data/docker/upstream/osfamily/windows.yaml @@ -1,3 +1,2 @@ ---- docker::settings: package_name: 'docker-engine' \ No newline at end of file diff --git a/data/nats-server/default.yaml b/data/nats-server/default.yaml index 3b4faeb5..15621d32 100644 --- a/data/nats-server/default.yaml +++ b/data/nats-server/default.yaml @@ -9,13 +9,7 @@ nats-server::settings: process_user: 'root' process_group: 'root' config_file_path: '/etc/nats/nats-server.conf' - pid_file_path: '/run/nats-server.pid' - init_file_path: '/etc/sysconfig/nats-server.conf' - log_file_path: - - '/var/log/nats-server/nats-server.log' - config_dir_path: '/etc/nats-server' - log_dir_path: - - '/var/log/nats-server' + config_dir_path: '/etc/nats' # tp 4 settings install_method: 'file' From 5f3434f731a5101922ad200a687ab4146b3fde89 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Thu, 12 Jan 2023 17:27:21 +0100 Subject: [PATCH 04/27] Updated reference and other v4 tinydata --- data/nats-server/default.yaml | 2 -- data/reference/default.yaml | 20 ++++++++++---------- data/reference/hiera.yaml | 8 ++++---- data/reference/osfamily/Darwin.yaml | 2 +- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/data/nats-server/default.yaml b/data/nats-server/default.yaml index 15621d32..9375c0e6 100644 --- a/data/nats-server/default.yaml +++ b/data/nats-server/default.yaml @@ -59,8 +59,6 @@ nats-server::settings: command: 'GO111MODULE=on go get github.com/nats-io/nats-server/v2' releases: - base_url: 'https://github.com/nats-io/nats-server/releases/download/' - file_format: zip latest_version: '2.9.11' prerequisites: {} base_url: 'https://github.com/nats-io/nats-server/releases/download/v$VERSION' diff --git a/data/reference/default.yaml b/data/reference/default.yaml index a09643fb..4ec7ea12 100644 --- a/data/reference/default.yaml +++ b/data/reference/default.yaml @@ -15,7 +15,7 @@ # Some v4 settings are used, as technology preview, in tp version 3.8.0 onwards. # Note that in every template used by the tp::conf define you can access to these settings -# (so that you can automatically configure in your own templates the right paths and names for +# (so that you can automatically configure in your own templates the right paths and names for # different underlying OSes) via the $settings variable (an hash with the settings values merged across the hierarchy). # For example to get the name of the user running a given app (as a service) you can use something like: # User <%= @settings['service']['main']['process_user'] %> # In erb templates @@ -24,7 +24,7 @@ # Port: <%= $settings['ports']['main']['port'] %> # Protocol: <%= $settings['ports']['main']['protocol'] %> # Note: Be sure the referred settings (and subkeys) exist in your tinydata to avoid errors like: -# Evaluation Error: Operator '[]' is not applicable to an Undef Value. +# Evaluation Error: Operator '[]' is not applicable to an Undef Value. # You can override these settings directly from tp defines using the parameter settings_hash (legacy) or, # starting from tp 4, also the parameter my_settings. Their content must be an hash, with the same structure @@ -550,7 +550,7 @@ reference::settings: path: '$HOME/.reference' # This is v4 setting which allows you specify how the app has to be installed. - # What is set here in tinydata can be overridden by the tp::install argument install_method. + # What is set here in tinydata can be overridden by the tp::install argument install_method. # Note however that not all the install methods might be available (or have the required tinydata) # for all the apps and OS. # Possible values are: @@ -574,7 +574,7 @@ reference::settings: list: 'reference debug' # An hash of extra commands used to test if the application is running or installed correctly. - # They are executed when running the tp test command or the tp::test task. v3 and v4 compatible. + # They are executed when running the tp test command or the tp::test task. v3 and v4 compatible. test_commands: status: 'reference status' @@ -725,7 +725,7 @@ reference::settings: # an array or an hash of resource titles with the relevant arguments prerequisites: {} - # The application latest known version released. This can be set the $version parameter of tp::install + # The application latest known version released. This can be set the $version parameter of tp::install # In the future, this value is going to be automatically updated, but it's likely to not be updated. # It's used when no specific version is set via tp::install. latest_version: '1.0.0' @@ -741,18 +741,18 @@ reference::settings: # The file_name of the archive to download file_name: 'reference-$VERSION.tar.gz' - # The format of the archive. Needed to find the right way to decompress it + # The format of the archive. Needed to find the right way to decompress it file_format: tar.gz # Url of the latest release of an app, in case it's a fixed url which never changes and always points to - # the latest version of the app. + # the latest version of the app. latest_url: ~ # The name of the directory extracted from the archive. This gets variables replacement as well. # If not set, the file name without the file_format extension will be used. - # If empty the archive is not extracted into a directory but contains direclty one more files. - # When this happens, the extracted_file setting is used to specify the name of an extracted file. - # If extracted_dir is not an empty string, then extracted_file is ignored. + # If empty the archive is not extracted into a directory but contains direclty one more files. + # When this happens, the extracted_file setting is used to specify the name of an extracted file. + # If extracted_dir is not an empty string, then extracted_file is ignored. extracted_dir: 'reference-$VERSION' extracted_file: '' diff --git a/data/reference/hiera.yaml b/data/reference/hiera.yaml index fcd4bfdc..4b10fbcc 100644 --- a/data/reference/hiera.yaml +++ b/data/reference/hiera.yaml @@ -14,15 +14,15 @@ # As in Hiera lookup is done from top to bottom, according to the merge method specified # when calling the tp_lookup function # Starting from tp version 3.8 the merge method has changed from 'merge' to 'deep_merge' -# This is not expected to have any impact on the existing TinyData but is required by -# the more complex tinydata v4 settings +# This is not expected to have any impact on the existing TinyData but is required by +# the more complex tinydata v4 settings # The lower levels in the hierarchy generally use a default to configure general settings # valid for all the apps (and in some cases different for OS and OS versions) # For each app you can have a different hiera.yaml with more or less levels # A minimal recommended hierarchy is as follows: -# - "%{title}/osfamily/%{osfamily}%{operatingsystemmajrelease}" +# - "%{title}/osfamily/%{osfamily}%{operatingsystemmajrelease}" # - "%{title}/osfamily/%{osfamily}" # - "%{title}/default" # - "default/%{operatingsystem}%{operatingsystemmajrelease}" @@ -30,7 +30,7 @@ # - default # That maps respectively to the following files in the tinydata module: -# Example with the app redis on RedHat9 +# Example with the app redis on RedHat9 # - data/redis/osfamily/RedHat9.yaml # - data/redis/osfamily/RedHat.yaml # - data/redis/default.yaml diff --git a/data/reference/osfamily/Darwin.yaml b/data/reference/osfamily/Darwin.yaml index 0edcb020..1c0e6be3 100644 --- a/data/reference/osfamily/Darwin.yaml +++ b/data/reference/osfamily/Darwin.yaml @@ -1,6 +1,6 @@ --- reference::settings: - # Name of brew package to install. This parameter is optional and currently + # Name of brew package to install. This parameter is optional and currently # redundant, as on MacOS brew is always used to manage packages and # the package_name setting is enough to define what package to install # via the homebrew provider. From 1b56a91dc3ff89f82a8e8f81be9b2347c89cb314 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Sat, 14 Jan 2023 11:00:47 +0100 Subject: [PATCH 05/27] More v4 data structure refinements + v3tov4 conversion script --- scripts/convert_v3_to_v4.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/convert_v3_to_v4.rb b/scripts/convert_v3_to_v4.rb index 0ba6c620..f308f21a 100644 --- a/scripts/convert_v3_to_v4.rb +++ b/scripts/convert_v3_to_v4.rb @@ -24,8 +24,8 @@ package_name = original_config[settings_key]['package_name'] original_config[settings_key]["packages"] = {"main" => {"name" => package_name}} if package_name # Get the package provider from the original config -#package_provider = original_config[settings_key]['package_provider'] -#original_config[settings_key]["packages"]["main"]["package_provider"] if package_provider +package_provider = original_config[settings_key]['package_provider'] +original_config[settings_key]["packages"]["main"]["package_provider"] if package_provider # Get the service name from the original config service_name = original_config[settings_key]['service_name'] From 76c3c957010a01824b806cd107077d74763abba1 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Sat, 21 Jan 2023 19:07:07 +0100 Subject: [PATCH 06/27] Defining v4 structure --- data/default/Debian.yaml | 1 - data/default/Ubuntu22.04.yaml | 2 +- scripts/convert_v3_to_v4.rb | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/data/default/Debian.yaml b/data/default/Debian.yaml index e9f3554c..cd9cdc24 100755 --- a/data/default/Debian.yaml +++ b/data/default/Debian.yaml @@ -7,6 +7,5 @@ default::settings: repos: default: package_provider: dpkg - image: dockerfile_prerequisites: 'RUN apt-get update && apt-get install -y --force-yes --no-install-recommends wget' \ No newline at end of file diff --git a/data/default/Ubuntu22.04.yaml b/data/default/Ubuntu22.04.yaml index e4c161a8..122a1075 100644 --- a/data/default/Ubuntu22.04.yaml +++ b/data/default/Ubuntu22.04.yaml @@ -2,7 +2,7 @@ default::settings: apt_release: 'jammy' - + repos: default: apt: diff --git a/scripts/convert_v3_to_v4.rb b/scripts/convert_v3_to_v4.rb index f308f21a..0ba6c620 100644 --- a/scripts/convert_v3_to_v4.rb +++ b/scripts/convert_v3_to_v4.rb @@ -24,8 +24,8 @@ package_name = original_config[settings_key]['package_name'] original_config[settings_key]["packages"] = {"main" => {"name" => package_name}} if package_name # Get the package provider from the original config -package_provider = original_config[settings_key]['package_provider'] -original_config[settings_key]["packages"]["main"]["package_provider"] if package_provider +#package_provider = original_config[settings_key]['package_provider'] +#original_config[settings_key]["packages"]["main"]["package_provider"] if package_provider # Get the service name from the original config service_name = original_config[settings_key]['service_name'] From d63c972bf5929f86cef7fa63aa7bb58cd33ea484 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 1 Feb 2023 19:40:57 +0100 Subject: [PATCH 07/27] More preparations for v4 --- data/default.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/default.yaml b/data/default.yaml index 226a0e37..e9033393 100644 --- a/data/default.yaml +++ b/data/default.yaml @@ -9,9 +9,9 @@ default::settings: config_file_mode: '0644' config_dir_owner: 'root' config_dir_group: 'root' - config_dir_mode: '0755' + config_dir_mode: '0644' config_dir_purge: false - config_dir_recurse: true + config_dir_recurse: false install_method: 'package' packages: From 7c36cac0d7145f26d227b990df79c05a65807948 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 1 Feb 2023 20:24:46 +0100 Subject: [PATCH 08/27] Yaml lints --- .yamllint.yaml | 2 +- data/default/Ubuntu22.04.yaml | 2 +- data/docker/upstream/osfamily/windows.yaml | 1 + data/nats-server/default.yaml | 2 +- data/nuclei/default.yaml | 2 +- data/reference/default.yaml | 31 +++++++++++++++------- data/reference/hiera.yaml | 2 +- data/reference/osfamily/Darwin.yaml | 2 +- 8 files changed, 29 insertions(+), 15 deletions(-) diff --git a/.yamllint.yaml b/.yamllint.yaml index 11ae79a5..87826d89 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -14,7 +14,7 @@ rules: level: warning empty-lines: disable empty-values: disable - float-values: disable +# float-values: disable hyphens: enable indentation: enable key-duplicates: enable diff --git a/data/default/Ubuntu22.04.yaml b/data/default/Ubuntu22.04.yaml index 122a1075..e4c161a8 100644 --- a/data/default/Ubuntu22.04.yaml +++ b/data/default/Ubuntu22.04.yaml @@ -2,7 +2,7 @@ default::settings: apt_release: 'jammy' - + repos: default: apt: diff --git a/data/docker/upstream/osfamily/windows.yaml b/data/docker/upstream/osfamily/windows.yaml index f2eb5d9b..4ea34537 100644 --- a/data/docker/upstream/osfamily/windows.yaml +++ b/data/docker/upstream/osfamily/windows.yaml @@ -1,2 +1,3 @@ +--- docker::settings: package_name: 'docker-engine' \ No newline at end of file diff --git a/data/nats-server/default.yaml b/data/nats-server/default.yaml index 9375c0e6..4530a941 100644 --- a/data/nats-server/default.yaml +++ b/data/nats-server/default.yaml @@ -11,7 +11,7 @@ nats-server::settings: config_file_path: '/etc/nats/nats-server.conf' config_dir_path: '/etc/nats' -# tp 4 settings + # tp 4 settings install_method: 'file' description: 'NATS is an open-source, high-performance, cloud native messaging system.' docker_image: 'nats' diff --git a/data/nuclei/default.yaml b/data/nuclei/default.yaml index 76d67bbe..f5f77628 100644 --- a/data/nuclei/default.yaml +++ b/data/nuclei/default.yaml @@ -9,7 +9,7 @@ nuclei::settings: validate_cmd: 'nuclei' config_dir_path: '$HOME/.config/nuclei' -# tp 4 settings + # tp 4 settings install_method: 'file' description: 'Fast and customizable vulnerability scanner based on simple YAML based DSL.' docker_image: 'projectdiscovery/nuclei' diff --git a/data/reference/default.yaml b/data/reference/default.yaml index 4ec7ea12..7bb2c1fc 100644 --- a/data/reference/default.yaml +++ b/data/reference/default.yaml @@ -15,7 +15,7 @@ # Some v4 settings are used, as technology preview, in tp version 3.8.0 onwards. # Note that in every template used by the tp::conf define you can access to these settings -# (so that you can automatically configure in your own templates the right paths and names for +# (so that you can automatically configure in your own templates the right paths and names for # different underlying OSes) via the $settings variable (an hash with the settings values merged across the hierarchy). # For example to get the name of the user running a given app (as a service) you can use something like: # User <%= @settings['service']['main']['process_user'] %> # In erb templates @@ -24,7 +24,7 @@ # Port: <%= $settings['ports']['main']['port'] %> # Protocol: <%= $settings['ports']['main']['protocol'] %> # Note: Be sure the referred settings (and subkeys) exist in your tinydata to avoid errors like: -# Evaluation Error: Operator '[]' is not applicable to an Undef Value. +# Evaluation Error: Operator '[]' is not applicable to an Undef Value. # You can override these settings directly from tp defines using the parameter settings_hash (legacy) or, # starting from tp 4, also the parameter my_settings. Their content must be an hash, with the same structure @@ -558,6 +558,15 @@ reference::settings: # file : the app is installed from a file downloaded and eventually extracted from an archive. Details under the release setting. # source : the app is installed and eventually compiled from the git source repository. Details under the build setting. # image : the app is installed as a Docker image. Details under the image setting. + # This is v4 setting which allows you specify how the app has to be installed. + # What is set here in tinydata can be overridden by the tp::install argument install_method. + # Note however that not all the install methods might be available (or have the required tinydata) + # for all the apps and OS. + # Possible values are: + # package: the app is installed from a system package and managed by Puppet's package resource. This is usually the default value. + # file : the app is installed from a file downloaded and eventually extracted from an archive. Details under the release setting. + # source : the app is installed and eventually compiled from the git source repository. Details under the build setting. + # image : the app is installed as a Docker image. Details under the image setting. install_method: 'package' # The description of the app. It's used by tp command. v4. @@ -574,14 +583,18 @@ reference::settings: list: 'reference debug' # An hash of extra commands used to test if the application is running or installed correctly. - # They are executed when running the tp test command or the tp::test task. v3 and v4 compatible. + # They are executed when running the tp test command or the tp::test task. v3 and v4 compatible. test_commands: status: 'reference status' + # The command to run to show the application's version. By default it's used appname --version, if a different command + # or argument is needed. Specify it here. v3 and v4 compatible. # The command to run to show the application's version. By default it's used appname --version, if a different command # or argument is needed. Specify it here. v3 and v4 compatible. version_command: 'reference version' + # The command to run to show the application's help. By default it's used appname --help, if a different command + # or argument is needed. Specify it here. v3 and v4 compatible. # The command to run to show the application's help. By default it's used appname --help, if a different command # or argument is needed. Specify it here. v3 and v4 compatible. help_command: 'reference help' @@ -725,7 +738,7 @@ reference::settings: # an array or an hash of resource titles with the relevant arguments prerequisites: {} - # The application latest known version released. This can be set the $version parameter of tp::install + # The application latest known version released. This can be set the $version parameter of tp::install # In the future, this value is going to be automatically updated, but it's likely to not be updated. # It's used when no specific version is set via tp::install. latest_version: '1.0.0' @@ -741,18 +754,18 @@ reference::settings: # The file_name of the archive to download file_name: 'reference-$VERSION.tar.gz' - # The format of the archive. Needed to find the right way to decompress it + # The format of the archive. Needed to find the right way to decompress it file_format: tar.gz # Url of the latest release of an app, in case it's a fixed url which never changes and always points to - # the latest version of the app. + # the latest version of the app. latest_url: ~ # The name of the directory extracted from the archive. This gets variables replacement as well. # If not set, the file name without the file_format extension will be used. - # If empty the archive is not extracted into a directory but contains direclty one more files. - # When this happens, the extracted_file setting is used to specify the name of an extracted file. - # If extracted_dir is not an empty string, then extracted_file is ignored. + # If empty the archive is not extracted into a directory but contains direclty one more files. + # When this happens, the extracted_file setting is used to specify the name of an extracted file. + # If extracted_dir is not an empty string, then extracted_file is ignored. extracted_dir: 'reference-$VERSION' extracted_file: '' diff --git a/data/reference/hiera.yaml b/data/reference/hiera.yaml index 4b10fbcc..92de42af 100644 --- a/data/reference/hiera.yaml +++ b/data/reference/hiera.yaml @@ -22,7 +22,7 @@ # For each app you can have a different hiera.yaml with more or less levels # A minimal recommended hierarchy is as follows: -# - "%{title}/osfamily/%{osfamily}%{operatingsystemmajrelease}" +# - "%{title}/osfamily/%{osfamily}%{operatingsystemmajrelease}" # - "%{title}/osfamily/%{osfamily}" # - "%{title}/default" # - "default/%{operatingsystem}%{operatingsystemmajrelease}" diff --git a/data/reference/osfamily/Darwin.yaml b/data/reference/osfamily/Darwin.yaml index 1c0e6be3..381682cf 100644 --- a/data/reference/osfamily/Darwin.yaml +++ b/data/reference/osfamily/Darwin.yaml @@ -1,6 +1,6 @@ --- reference::settings: - # Name of brew package to install. This parameter is optional and currently + # Name of brew package to install. This parameter is optional and currently # redundant, as on MacOS brew is always used to manage packages and # the package_name setting is enough to define what package to install # via the homebrew provider. From 03517f8f6c5accbee5cefe152470fe95f09c7e4a Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 1 Feb 2023 20:52:56 +0100 Subject: [PATCH 09/27] Yaml lints 2 --- .yamllint.yaml | 2 +- data/reference/hiera.yaml | 6 +++--- data/reference/osfamily/Darwin.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.yamllint.yaml b/.yamllint.yaml index 87826d89..11ae79a5 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -14,7 +14,7 @@ rules: level: warning empty-lines: disable empty-values: disable -# float-values: disable + float-values: disable hyphens: enable indentation: enable key-duplicates: enable diff --git a/data/reference/hiera.yaml b/data/reference/hiera.yaml index 92de42af..fcd4bfdc 100644 --- a/data/reference/hiera.yaml +++ b/data/reference/hiera.yaml @@ -14,8 +14,8 @@ # As in Hiera lookup is done from top to bottom, according to the merge method specified # when calling the tp_lookup function # Starting from tp version 3.8 the merge method has changed from 'merge' to 'deep_merge' -# This is not expected to have any impact on the existing TinyData but is required by -# the more complex tinydata v4 settings +# This is not expected to have any impact on the existing TinyData but is required by +# the more complex tinydata v4 settings # The lower levels in the hierarchy generally use a default to configure general settings # valid for all the apps (and in some cases different for OS and OS versions) @@ -30,7 +30,7 @@ # - default # That maps respectively to the following files in the tinydata module: -# Example with the app redis on RedHat9 +# Example with the app redis on RedHat9 # - data/redis/osfamily/RedHat9.yaml # - data/redis/osfamily/RedHat.yaml # - data/redis/default.yaml diff --git a/data/reference/osfamily/Darwin.yaml b/data/reference/osfamily/Darwin.yaml index 381682cf..0edcb020 100644 --- a/data/reference/osfamily/Darwin.yaml +++ b/data/reference/osfamily/Darwin.yaml @@ -1,6 +1,6 @@ --- reference::settings: - # Name of brew package to install. This parameter is optional and currently + # Name of brew package to install. This parameter is optional and currently # redundant, as on MacOS brew is always used to manage packages and # the package_name setting is enough to define what package to install # via the homebrew provider. From 56c9777e3cd0ff74f95f2b7a9f066e522d7bb080 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Thu, 2 Feb 2023 11:06:45 +0100 Subject: [PATCH 10/27] Fixing --- data/apm-server/osfamily/RedHat9.yaml | 2 +- data/auditbeat/osfamily/RedHat9.yaml | 2 +- data/microsoft_repo/upstream/default.yaml | 2 +- data/prometheus/default.yaml | 8 +++---- data/spiderfoot/default.yaml | 28 ++++++++++++---------- data/sysdig/upstream/osfamily/RedHat9.yaml | 11 +++++++++ 6 files changed, 34 insertions(+), 19 deletions(-) create mode 100644 data/sysdig/upstream/osfamily/RedHat9.yaml diff --git a/data/apm-server/osfamily/RedHat9.yaml b/data/apm-server/osfamily/RedHat9.yaml index e73b9caa..5b73c181 100644 --- a/data/apm-server/osfamily/RedHat9.yaml +++ b/data/apm-server/osfamily/RedHat9.yaml @@ -1,5 +1,5 @@ --- -# Workaround for GPG-KEY in SHA1 https://github.com/elastic/elasticsearch/issues/85876 +# Workaround for GPG-KEY in SHA1 https://www.redhat.com/en/blog/rhel-security-sha-1-package-signatures-distrusted-rhel-9 apm-server::settings: exec_prerequisites: allow_sha1: diff --git a/data/auditbeat/osfamily/RedHat9.yaml b/data/auditbeat/osfamily/RedHat9.yaml index 1560e4f7..427d4587 100644 --- a/data/auditbeat/osfamily/RedHat9.yaml +++ b/data/auditbeat/osfamily/RedHat9.yaml @@ -1,5 +1,5 @@ --- -# Workaround for GPG-KEY in SHA1 https://github.com/elastic/elasticsearch/issues/85876 +# Workaround for GPG-KEY in SHA1 https://www.redhat.com/en/blog/rhel-security-sha-1-package-signatures-distrusted-rhel-9 auditbeat::settings: exec_prerequisites: allow_sha1: diff --git a/data/microsoft_repo/upstream/default.yaml b/data/microsoft_repo/upstream/default.yaml index cab3a474..791c8afe 100644 --- a/data/microsoft_repo/upstream/default.yaml +++ b/data/microsoft_repo/upstream/default.yaml @@ -1,4 +1,4 @@ --- microsoft_repo::settings: - repo_filename: packages-microsoft-prod + repo_filename: microsoft-prod repo_package_name: packages-microsoft-prod \ No newline at end of file diff --git a/data/prometheus/default.yaml b/data/prometheus/default.yaml index fef0ee28..cb420c06 100644 --- a/data/prometheus/default.yaml +++ b/data/prometheus/default.yaml @@ -17,11 +17,7 @@ prometheus::settings: # validate_cmd: 'prometheus validate' pid_file_path: '' init_file_path: '/etc/sysconfig/prometheus.conf' - log_file_path: - - '/var/log/prometheus/prometheus.log' - - '/var/log/prometheus/prometheus-node-exporter.log' config_dir_path: '/etc/prometheus' - log_dir_path: '/var/log/prometheus' # tp 4 settings @@ -125,6 +121,9 @@ prometheus::settings: /var/log/prometheus: ensure: directory owner: prometheus + /var/lib/prometheus: + ensure: directory + owner: prometheus exec: prometheus_init_config: command: 'touch /etc/sysconfig/prometheus.conf' @@ -132,6 +131,7 @@ prometheus::settings: systemd_options: Service: ExecStart: '/usr/local/bin/prometheus --config.file /etc/prometheus/prometheus.yml' + WorkingDirectory: '/var/lib/prometheus' manage_service: true manage_user: true diff --git a/data/spiderfoot/default.yaml b/data/spiderfoot/default.yaml index c08404c6..d1e34419 100644 --- a/data/spiderfoot/default.yaml +++ b/data/spiderfoot/default.yaml @@ -18,9 +18,6 @@ spiderfoot::settings: # tp 4 settings description: 'SpiderFoot automates OSINT so you can find what matters, faster.' - website: 'https://www.spiderfoot.net/' - issues: 'https://github.com/smicallef/spiderfoot/issues' - ports: main: port: 5001 @@ -46,12 +43,19 @@ spiderfoot::settings: extracted_dir: 'spiderfoot-$VERSION' file_format: 'zip' - setup: - enable: true - systemd_options: - Service: - ExecStart: '/var/lib/tp/source/spiderfoot/sf.py -l 0.0.0.0:5001' - EnvironmentFile: ~ - manage_service: true - manage_user: false - + source: + setup: + enable: true + systemd_options: + Service: + ExecStart: '/var/lib/tp/source/spiderfoot/sf.py -l 0.0.0.0:5001' + EnvironmentFile: ~ + WorkingDirectory: '/var/lib/tp/source/spiderfoot' + manage_service: true + manage_user: false + + urls: + website: https://www.spiderfoot.net/ + issues: https://github.com/smicallef/spiderfoot/issues + documentation: https://www.spiderfoot.net/documentation/ + source: https://github.com/smicallef/spiderfoot diff --git a/data/sysdig/upstream/osfamily/RedHat9.yaml b/data/sysdig/upstream/osfamily/RedHat9.yaml new file mode 100644 index 00000000..c55069de --- /dev/null +++ b/data/sysdig/upstream/osfamily/RedHat9.yaml @@ -0,0 +1,11 @@ +--- +# Workaround for GPG-KEY in SHA1 https://www.redhat.com/en/blog/rhel-security-sha-1-package-signatures-distrusted-rhel-9 +sysdig::settings: + exec_prerequisites: + allow_sha1: + command: '/usr/bin/update-crypto-policies --set DEFAULT:SHA1' + unless: 'rpm -qi sysdig' + exec_postinstall: + disallow_sha1: + command: '/usr/bin/update-crypto-policies --set DEFAULT' + unless: 'rpm -qi sysdig' From b897da49e4036bfa55c679f13272a3179d7835cc Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Thu, 2 Feb 2023 18:47:51 +0100 Subject: [PATCH 11/27] Updates --- data/apm-server/osfamily/RedHat9.yaml | 4 ++-- data/auditbeat/osfamily/RedHat9.yaml | 4 ++-- data/default.yaml | 4 ++-- data/sysdig/hiera.yaml | 1 + data/sysdig/upstream/osfamily/RedHat9.yaml | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/data/apm-server/osfamily/RedHat9.yaml b/data/apm-server/osfamily/RedHat9.yaml index 5b73c181..d12b337f 100644 --- a/data/apm-server/osfamily/RedHat9.yaml +++ b/data/apm-server/osfamily/RedHat9.yaml @@ -4,8 +4,8 @@ apm-server::settings: exec_prerequisites: allow_sha1: command: '/usr/bin/update-crypto-policies --set DEFAULT:SHA1' - unless: 'rpm -qi apm-server' + unless: 'dnf info apm-server' exec_postinstall: disallow_sha1: command: '/usr/bin/update-crypto-policies --set DEFAULT' - unless: 'rpm -qi apm-server' + onlyif: '/usr/bin/update-crypto-policies --show | grep SHA1' diff --git a/data/auditbeat/osfamily/RedHat9.yaml b/data/auditbeat/osfamily/RedHat9.yaml index 427d4587..26191d31 100644 --- a/data/auditbeat/osfamily/RedHat9.yaml +++ b/data/auditbeat/osfamily/RedHat9.yaml @@ -4,8 +4,8 @@ auditbeat::settings: exec_prerequisites: allow_sha1: command: '/usr/bin/update-crypto-policies --set DEFAULT:SHA1' - unless: 'rpm -qi auditbeat' + unless: 'dnf info auditbeat' exec_postinstall: disallow_sha1: command: '/usr/bin/update-crypto-policies --set DEFAULT' - unless: 'rpm -qi auditbeat' + onlyif: '/usr/bin/update-crypto-policies --show | grep SHA1' diff --git a/data/default.yaml b/data/default.yaml index e9033393..226a0e37 100644 --- a/data/default.yaml +++ b/data/default.yaml @@ -9,9 +9,9 @@ default::settings: config_file_mode: '0644' config_dir_owner: 'root' config_dir_group: 'root' - config_dir_mode: '0644' + config_dir_mode: '0755' config_dir_purge: false - config_dir_recurse: false + config_dir_recurse: true install_method: 'package' packages: diff --git a/data/sysdig/hiera.yaml b/data/sysdig/hiera.yaml index 1c820bbc..79a0789e 100644 --- a/data/sysdig/hiera.yaml +++ b/data/sysdig/hiera.yaml @@ -2,6 +2,7 @@ :hierarchy: - "%{title}/upstream/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" - "%{title}/upstream/operatingsystem/%{operatingsystem}" + - "%{title}/upstream/osfamily/%{osfamily}%{operatingsystemmajrelease}" - "%{title}/upstream/osfamily/%{osfamily}" - "%{title}/upstream/default" - "%{title}/default" diff --git a/data/sysdig/upstream/osfamily/RedHat9.yaml b/data/sysdig/upstream/osfamily/RedHat9.yaml index c55069de..a21b479a 100644 --- a/data/sysdig/upstream/osfamily/RedHat9.yaml +++ b/data/sysdig/upstream/osfamily/RedHat9.yaml @@ -4,8 +4,8 @@ sysdig::settings: exec_prerequisites: allow_sha1: command: '/usr/bin/update-crypto-policies --set DEFAULT:SHA1' - unless: 'rpm -qi sysdig' + unless: 'dnf info sysdig' exec_postinstall: disallow_sha1: command: '/usr/bin/update-crypto-policies --set DEFAULT' - unless: 'rpm -qi sysdig' + onlyif: '/usr/bin/update-crypto-policies --show | grep SHA1' From c97e72215da8f9d3435b5ab802b47ddb43dacf9b Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Thu, 2 Feb 2023 18:51:12 +0100 Subject: [PATCH 12/27] Removed duplications --- data/reference/default.yaml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/data/reference/default.yaml b/data/reference/default.yaml index 7bb2c1fc..a09643fb 100644 --- a/data/reference/default.yaml +++ b/data/reference/default.yaml @@ -549,15 +549,6 @@ reference::settings: config: path: '$HOME/.reference' - # This is v4 setting which allows you specify how the app has to be installed. - # What is set here in tinydata can be overridden by the tp::install argument install_method. - # Note however that not all the install methods might be available (or have the required tinydata) - # for all the apps and OS. - # Possible values are: - # package: the app is installed from a system package and managed by Puppet's package resource. This is usually the default value. - # file : the app is installed from a file downloaded and eventually extracted from an archive. Details under the release setting. - # source : the app is installed and eventually compiled from the git source repository. Details under the build setting. - # image : the app is installed as a Docker image. Details under the image setting. # This is v4 setting which allows you specify how the app has to be installed. # What is set here in tinydata can be overridden by the tp::install argument install_method. # Note however that not all the install methods might be available (or have the required tinydata) @@ -587,14 +578,10 @@ reference::settings: test_commands: status: 'reference status' - # The command to run to show the application's version. By default it's used appname --version, if a different command - # or argument is needed. Specify it here. v3 and v4 compatible. # The command to run to show the application's version. By default it's used appname --version, if a different command # or argument is needed. Specify it here. v3 and v4 compatible. version_command: 'reference version' - # The command to run to show the application's help. By default it's used appname --help, if a different command - # or argument is needed. Specify it here. v3 and v4 compatible. # The command to run to show the application's help. By default it's used appname --help, if a different command # or argument is needed. Specify it here. v3 and v4 compatible. help_command: 'reference help' From b39656b31238cef45c9b7c91165d17ff84ff2457 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Tue, 7 Feb 2023 10:56:29 +0100 Subject: [PATCH 13/27] Surfex sample implementation --- data/surfex/default.yaml | 47 ++++++++++++++++++++++++++++++++++++++++ data/surfex/hiera.yaml | 15 +++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 data/surfex/default.yaml create mode 100644 data/surfex/hiera.yaml diff --git a/data/surfex/default.yaml b/data/surfex/default.yaml new file mode 100644 index 00000000..add279a3 --- /dev/null +++ b/data/surfex/default.yaml @@ -0,0 +1,47 @@ +--- +surfex::settings: + tp_prerequisites: {} + + urls: + website: 'http://www.umr-cnrm.fr/surfex/' + documentation: 'http://www.umr-cnrm.fr/surfex/' + source: 'https://github.com/surfex/surfex' + description: 'SURFEX (Surface Externalisée, in French) is a surface modelling platform' + + # Configured: +package -source -file +image + install_method: 'file' + + build: + enable: true + prerequisites: + tp::install: + - build-essential + execs: + - name: configure + command: 'cd src ; ./configure' + # TODO: Add source of generated model + - name: build + command: 'make' + - name: setup + command: 'make installmaster' + setup: + enable: true + systemd_options: {} + resources: {} + manage_service: false + manage_user: false + + releases: + latest_version: 'v9_0_0' + prerequisites: {} + latest_url: ~ + base_url: 'https://www.umr-cnrm.fr/surfex/data/OPEN-SURFEX' + file_name: 'open_surfex_$VERSION.tar.gz' + extracted_dir: 'OPEN_SURFEX_V9' +# extracted_dir: 'open_SURFEX_V$MAJVERSION' + file_format: tar.gz + setup: + enable: true + resources: {} + manage_service: false + manage_user: false diff --git a/data/surfex/hiera.yaml b/data/surfex/hiera.yaml new file mode 100644 index 00000000..b2a2fa6a --- /dev/null +++ b/data/surfex/hiera.yaml @@ -0,0 +1,15 @@ +--- +:hierarchy: + - "%{title}/%{repo}/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/%{repo}/operatingsystem/%{operatingsystem}" + - "%{title}/%{repo}/osfamily/%{osfamily}%{operatingsystemmajrelease}" + - "%{title}/%{repo}/osfamily/%{osfamily}" + - "%{title}/%{repo}/default" + - "%{title}/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/operatingsystem/%{operatingsystem}" + - "%{title}/osfamily/%{osfamily}%{operatingsystemmajrelease}" + - "%{title}/osfamily/%{osfamily}" + - "%{title}/default" + - "default/%{operatingsystem}%{operatingsystemmajrelease}" + - "default/%{operatingsystem}" + - default From e83d02a9d6024245a20c53d88cdc9f6274b50d0b Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Tue, 7 Feb 2023 11:11:30 +0100 Subject: [PATCH 14/27] Temporary nix data #70 --- data/nix/default.yaml | 95 ++++++++++++++++++++++++++++++++++ data/nix/hiera.yaml | 15 ++++++ data/nix/osfamily/Darwin.yaml | 11 ++++ data/nix/osfamily/Debian.yaml | 6 +++ data/nix/osfamily/RedHat.yaml | 3 ++ data/nix/osfamily/windows.yaml | 14 +++++ 6 files changed, 144 insertions(+) create mode 100644 data/nix/default.yaml create mode 100644 data/nix/hiera.yaml create mode 100644 data/nix/osfamily/Darwin.yaml create mode 100644 data/nix/osfamily/Debian.yaml create mode 100644 data/nix/osfamily/RedHat.yaml create mode 100644 data/nix/osfamily/windows.yaml diff --git a/data/nix/default.yaml b/data/nix/default.yaml new file mode 100644 index 00000000..035179f4 --- /dev/null +++ b/data/nix/default.yaml @@ -0,0 +1,95 @@ +--- +nix::settings: + tp_prerequisites: {} + exec_prerequisites: + install: + command: 'sh <(curl -L https://nixos.org/nix/install) --daemon' + creates: '/nix' + + urls: + website: 'https://nixos.org' + issues: 'https://github.com/nixos/nix/issues' + documentation: 'https://nix.com/documentation' + source: 'https://github.com/nix/nix' + description: 'nix description' + + # Configured: +package -source -file +image + install_method: 'source' + + packages: [] + manage_package: false + prerequisites: + exec: + command: 'sh <(curl -L https://nixos.org/nix/install) --daemon' + creates: '/nix' + + services: + main: + name: nix-daemon + process_name: nix + process_extra_name: ~ + process_user: root + process_group: root + nodaemon_args: '-D' + ensure: running + enable: true + pidfile: /run/nix.pid + params: {} + + + files: + config: + path: '/etc/nix/nix.conf' + init: + path: '/etc/sysconfig/nix-daemon.conf' + format: 'inifile' + systemd: + path: '/etc/systemd/system/nix-daemon.service' + format: 'inifile_with_stanzas' + + dirs: + config: + path: '/etc/nix' + metadata: + path: /nix/var/nix + log: + path: /nix/var/log + store: + path: /nix + + user_files: + config: + path: '$HOME/.config/nix/nix.conf' + + user_dirs: + config: + path: '$HOME/.config/nix' + + info_commands: + list_profile: 'nix profile list' + list_store: 'nix store ls' + debug_commands: + debug: 'nix store verify' + test_commands: + status: 'nix status' + version_command: 'nix --version' + help_command: 'nix --help' + run_commands: + start: + command: 'nix start' + + image: + name: 'nixos/nix' + systemd_options: {} + + releases: + latest_version: 2.13.2 + latest_url: ~ + base_url: 'https://releases.nixos.org/nix/nix-$VERSION/nix-$VERSION-$OS.tar.xz' + file_name: 'nix-$VERSION-$OS.tar.xz' + extracted_dir: 'nix-$VERSION-$OS' + file_format: xz + prerequisites: + exec: + command: 'sh <(curl -L https://nixos.org/nix/install) --daemon' + creates: '/nix' diff --git a/data/nix/hiera.yaml b/data/nix/hiera.yaml new file mode 100644 index 00000000..b2a2fa6a --- /dev/null +++ b/data/nix/hiera.yaml @@ -0,0 +1,15 @@ +--- +:hierarchy: + - "%{title}/%{repo}/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/%{repo}/operatingsystem/%{operatingsystem}" + - "%{title}/%{repo}/osfamily/%{osfamily}%{operatingsystemmajrelease}" + - "%{title}/%{repo}/osfamily/%{osfamily}" + - "%{title}/%{repo}/default" + - "%{title}/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/operatingsystem/%{operatingsystem}" + - "%{title}/osfamily/%{osfamily}%{operatingsystemmajrelease}" + - "%{title}/osfamily/%{osfamily}" + - "%{title}/default" + - "default/%{operatingsystem}%{operatingsystemmajrelease}" + - "default/%{operatingsystem}" + - default diff --git a/data/nix/osfamily/Darwin.yaml b/data/nix/osfamily/Darwin.yaml new file mode 100644 index 00000000..28548fc3 --- /dev/null +++ b/data/nix/osfamily/Darwin.yaml @@ -0,0 +1,11 @@ +--- +nix::settings: + brew_package_name: 'nix' + + user_files: + config: + path: '$HOME/Library/Application\ Support/nix/nix.conf' + + user_dirs: + config: + path: '$HOME/Library/Application\ Support/nix/nix.conf' \ No newline at end of file diff --git a/data/nix/osfamily/Debian.yaml b/data/nix/osfamily/Debian.yaml new file mode 100644 index 00000000..b3ed05e4 --- /dev/null +++ b/data/nix/osfamily/Debian.yaml @@ -0,0 +1,6 @@ +--- +nix::settings: + + files: + init: + path: '/etc/default/nix' \ No newline at end of file diff --git a/data/nix/osfamily/RedHat.yaml b/data/nix/osfamily/RedHat.yaml new file mode 100644 index 00000000..4c7da897 --- /dev/null +++ b/data/nix/osfamily/RedHat.yaml @@ -0,0 +1,3 @@ +--- +nix::settings: + dockerfile_prerequisites: 'RUN yum install -y wget which' diff --git a/data/nix/osfamily/windows.yaml b/data/nix/osfamily/windows.yaml new file mode 100644 index 00000000..98b96c60 --- /dev/null +++ b/data/nix/osfamily/windows.yaml @@ -0,0 +1,14 @@ +--- +nix::settings: + + # If exe or msi package is available for direct download: + package_provider: 'windows' + package_source: 'https://github.com/nix/nix/releases/download/v$VERSION/nix_$VERSION_$OS_$ARCH.msi' + + user_files: + config: + path: '%APPDATA%\nix\nix.conf' + + user_dirs: + config: + path: '%APPDATA%\nix' \ No newline at end of file From 8c7105e6f335d6be4cde05e0f894547777248a9f Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 15 Feb 2023 18:49:47 +0100 Subject: [PATCH 15/27] Data for nix #70 --- data/nix/default.yaml | 40 +++++++++++++++------------------- data/nix/osfamily/Darwin.yaml | 11 ---------- data/nix/osfamily/Debian.yaml | 6 ----- data/nix/osfamily/RedHat.yaml | 3 --- data/nix/osfamily/windows.yaml | 14 ------------ 5 files changed, 18 insertions(+), 56 deletions(-) delete mode 100644 data/nix/osfamily/Darwin.yaml delete mode 100644 data/nix/osfamily/Debian.yaml delete mode 100644 data/nix/osfamily/RedHat.yaml delete mode 100644 data/nix/osfamily/windows.yaml diff --git a/data/nix/default.yaml b/data/nix/default.yaml index 035179f4..97cc3953 100644 --- a/data/nix/default.yaml +++ b/data/nix/default.yaml @@ -3,40 +3,34 @@ nix::settings: tp_prerequisites: {} exec_prerequisites: install: - command: 'sh <(curl -L https://nixos.org/nix/install) --daemon' +# command: 'sh <(curl -L https://nixos.org/nix/install) --daemon' + command: 'curl -L https://nixos.org/nix/install -o /tmp/nix_install ; sh /tmp/nix_install --daemon | yes' creates: '/nix' + provider: posix urls: website: 'https://nixos.org' issues: 'https://github.com/nixos/nix/issues' - documentation: 'https://nix.com/documentation' - source: 'https://github.com/nix/nix' - description: 'nix description' + documentation: 'https://nixos.org/learn.html' + source: 'https://github.com/nixos/nix' + description: 'The purely functional package manager' # Configured: +package -source -file +image - install_method: 'source' + install_method: 'package' - packages: [] + packages: {} manage_package: false - prerequisites: - exec: - command: 'sh <(curl -L https://nixos.org/nix/install) --daemon' - creates: '/nix' services: - main: - name: nix-daemon + nix-daemon: process_name: nix process_extra_name: ~ process_user: root process_group: root nodaemon_args: '-D' - ensure: running - enable: true pidfile: /run/nix.pid params: {} - files: config: path: '/etc/nix/nix.conf' @@ -74,22 +68,24 @@ nix::settings: status: 'nix status' version_command: 'nix --version' help_command: 'nix --help' - run_commands: - start: - command: 'nix start' image: name: 'nixos/nix' systemd_options: {} - releases: + release: latest_version: 2.13.2 latest_url: ~ base_url: 'https://releases.nixos.org/nix/nix-$VERSION/nix-$VERSION-$OS.tar.xz' file_name: 'nix-$VERSION-$OS.tar.xz' extracted_dir: 'nix-$VERSION-$OS' file_format: xz - prerequisites: + + setupa: + enable: true + resources: exec: - command: 'sh <(curl -L https://nixos.org/nix/install) --daemon' - creates: '/nix' + install_nix: + command: 'curl -L https://nixos.org/nix/install --daemon | bash' + creates: '/nix' + provider: shell \ No newline at end of file diff --git a/data/nix/osfamily/Darwin.yaml b/data/nix/osfamily/Darwin.yaml deleted file mode 100644 index 28548fc3..00000000 --- a/data/nix/osfamily/Darwin.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -nix::settings: - brew_package_name: 'nix' - - user_files: - config: - path: '$HOME/Library/Application\ Support/nix/nix.conf' - - user_dirs: - config: - path: '$HOME/Library/Application\ Support/nix/nix.conf' \ No newline at end of file diff --git a/data/nix/osfamily/Debian.yaml b/data/nix/osfamily/Debian.yaml deleted file mode 100644 index b3ed05e4..00000000 --- a/data/nix/osfamily/Debian.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -nix::settings: - - files: - init: - path: '/etc/default/nix' \ No newline at end of file diff --git a/data/nix/osfamily/RedHat.yaml b/data/nix/osfamily/RedHat.yaml deleted file mode 100644 index 4c7da897..00000000 --- a/data/nix/osfamily/RedHat.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -nix::settings: - dockerfile_prerequisites: 'RUN yum install -y wget which' diff --git a/data/nix/osfamily/windows.yaml b/data/nix/osfamily/windows.yaml deleted file mode 100644 index 98b96c60..00000000 --- a/data/nix/osfamily/windows.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -nix::settings: - - # If exe or msi package is available for direct download: - package_provider: 'windows' - package_source: 'https://github.com/nix/nix/releases/download/v$VERSION/nix_$VERSION_$OS_$ARCH.msi' - - user_files: - config: - path: '%APPDATA%\nix\nix.conf' - - user_dirs: - config: - path: '%APPDATA%\nix' \ No newline at end of file From 417b603d8f74f443147a1db2986001ff9f722acf Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 15 Feb 2023 18:50:38 +0100 Subject: [PATCH 16/27] Data for surkex #71 --- data/surfex/default.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/surfex/default.yaml b/data/surfex/default.yaml index add279a3..183573e7 100644 --- a/data/surfex/default.yaml +++ b/data/surfex/default.yaml @@ -8,8 +8,8 @@ surfex::settings: source: 'https://github.com/surfex/surfex' description: 'SURFEX (Surface Externalisée, in French) is a surface modelling platform' - # Configured: +package -source -file +image - install_method: 'file' + # Configured: -package -source +release -image + install_method: 'release' build: enable: true @@ -31,7 +31,7 @@ surfex::settings: manage_service: false manage_user: false - releases: + release: latest_version: 'v9_0_0' prerequisites: {} latest_url: ~ From 2e4bfc8fcf7d54267b0c1022f2a64e18b3017d16 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 15 Feb 2023 18:51:44 +0100 Subject: [PATCH 17/27] Data for golang #68 --- data/golang/default.yaml | 87 +++++++++++++++++++++++++++++++ data/golang/hiera.yaml | 15 ++++++ data/golang/osfamily/Darwin.yaml | 5 ++ data/golang/osfamily/Debian.yaml | 6 +++ data/golang/osfamily/RedHat.yaml | 3 ++ data/golang/osfamily/windows.yaml | 14 +++++ 6 files changed, 130 insertions(+) create mode 100644 data/golang/default.yaml create mode 100644 data/golang/hiera.yaml create mode 100644 data/golang/osfamily/Darwin.yaml create mode 100644 data/golang/osfamily/Debian.yaml create mode 100644 data/golang/osfamily/RedHat.yaml create mode 100644 data/golang/osfamily/windows.yaml diff --git a/data/golang/default.yaml b/data/golang/default.yaml new file mode 100644 index 00000000..2b7d9bbc --- /dev/null +++ b/data/golang/default.yaml @@ -0,0 +1,87 @@ +--- +golang::settings: + tp_prerequisites: {} + + urls: + website: 'https://go.dev' + issues: 'https://github.com/golang/go/issues' + documentation: 'https://go.dev/doc/' + source: 'https://github.com/golang/go' + description: 'The Go programming language' + + # Configured: +package -source -file +image + install_method: 'package' + + packages: + main: + name: golang + ensure: present + source: ~ + install_options: [] + params: {} + providers: + chocolatey: + name: golang + scoop: + name: go + winget: + name: ~ + snap: + name: go + brew: + name: go + + info_commands: + list: 'go list' + debug_commands: + debug: 'go debug' + test_commands: + status: 'go status' + version_command: 'go version' + help_command: 'go help' + run_commands: + start: + command: 'golang start' + + image: + name: 'golang' + + build: + prerequisites: + tp::install: + - build-essential + execs: + - name: configure + command: './configure' + - name: build + command: 'make' + - name: setup + command: 'make install' + setup: + enable: true + files: + golang: + path: '/usr/local/bin/golang' + mode: '0755' + systemd_options: {} + resources: {} + manage_service: false + manage_user: false + + release: + latest_version: ~ + prerequisites: {} + latest_url: ~ + base_url: 'https://go.dev/dl/go$VERSION.$OS-$ARCH.tar.gz' + file_name: 'go$VERSION.$OS-$ARCH..tar.gz' + extracted_dir: 'go$VERSION.$OS-$ARCH.tar.gz' + file_format: tar.gz + setup: + enable: true + files: + golang: + path: '/usr/local/bin/golang' + mode: '0755' + resources: {} + manage_service: false + manage_user: false diff --git a/data/golang/hiera.yaml b/data/golang/hiera.yaml new file mode 100644 index 00000000..b2a2fa6a --- /dev/null +++ b/data/golang/hiera.yaml @@ -0,0 +1,15 @@ +--- +:hierarchy: + - "%{title}/%{repo}/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/%{repo}/operatingsystem/%{operatingsystem}" + - "%{title}/%{repo}/osfamily/%{osfamily}%{operatingsystemmajrelease}" + - "%{title}/%{repo}/osfamily/%{osfamily}" + - "%{title}/%{repo}/default" + - "%{title}/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/operatingsystem/%{operatingsystem}" + - "%{title}/osfamily/%{osfamily}%{operatingsystemmajrelease}" + - "%{title}/osfamily/%{osfamily}" + - "%{title}/default" + - "default/%{operatingsystem}%{operatingsystemmajrelease}" + - "default/%{operatingsystem}" + - default diff --git a/data/golang/osfamily/Darwin.yaml b/data/golang/osfamily/Darwin.yaml new file mode 100644 index 00000000..7e96c2ca --- /dev/null +++ b/data/golang/osfamily/Darwin.yaml @@ -0,0 +1,5 @@ +--- +golang::settings: + + release: + https://go.dev/dl/go1.20.darwin-arm64.pkg \ No newline at end of file diff --git a/data/golang/osfamily/Debian.yaml b/data/golang/osfamily/Debian.yaml new file mode 100644 index 00000000..620a6a05 --- /dev/null +++ b/data/golang/osfamily/Debian.yaml @@ -0,0 +1,6 @@ +--- +golang::settings: + + files: + init: + path: '/etc/default/golang' \ No newline at end of file diff --git a/data/golang/osfamily/RedHat.yaml b/data/golang/osfamily/RedHat.yaml new file mode 100644 index 00000000..5292c963 --- /dev/null +++ b/data/golang/osfamily/RedHat.yaml @@ -0,0 +1,3 @@ +--- +golang::settings: + dockerfile_prerequisites: 'RUN yum install -y wget which' diff --git a/data/golang/osfamily/windows.yaml b/data/golang/osfamily/windows.yaml new file mode 100644 index 00000000..39ceff9c --- /dev/null +++ b/data/golang/osfamily/windows.yaml @@ -0,0 +1,14 @@ +--- +golang::settings: + + # If exe or msi package is available for direct download: + package_provider: 'windows' + package_source: 'https://go.dev/dl/go$VERSION.$OS-$ARCH.msi' + + user_files: + config: + path: '%APPDATA%\golang\golang.conf' + + user_dirs: + config: + path: '%APPDATA%\golang' \ No newline at end of file From ad1ecf76744eb8661ba268c7826ce90c92cb0f3a Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 15 Feb 2023 18:52:13 +0100 Subject: [PATCH 18/27] Data for mgmt #67 --- data/mgmt/default.yaml | 118 ++++++++++++++++++++++++++++++++ data/mgmt/hiera.yaml | 15 ++++ data/mgmt/osfamily/Darwin.yaml | 11 +++ data/mgmt/osfamily/Debian.yaml | 6 ++ data/mgmt/osfamily/RedHat.yaml | 3 + data/mgmt/osfamily/windows.yaml | 14 ++++ 6 files changed, 167 insertions(+) create mode 100644 data/mgmt/default.yaml create mode 100644 data/mgmt/hiera.yaml create mode 100644 data/mgmt/osfamily/Darwin.yaml create mode 100644 data/mgmt/osfamily/Debian.yaml create mode 100644 data/mgmt/osfamily/RedHat.yaml create mode 100644 data/mgmt/osfamily/windows.yaml diff --git a/data/mgmt/default.yaml b/data/mgmt/default.yaml new file mode 100644 index 00000000..050f736c --- /dev/null +++ b/data/mgmt/default.yaml @@ -0,0 +1,118 @@ +--- +mgmt::settings: + tp_prerequisites: {} + + urls: + website: 'https://github.com/purpleidea/mgmt' + issues: 'https://github.com/purpleidea/mgmt/issues' + documentation: 'https://github.com/purpleidea/mgmt/blob/master/docs/documentation.md' + source: 'https://github.com/purpleidea/mgmt' + description: 'Mgmt is a real-time automation tool.' + + # Configured: -package -source +release -image + install_method: 'release' + + packages: + main: + name: mgmt + + services: + mgmt: + process_name: mgmt + process_extra_name: ~ + process_user: root + process_group: root + nodaemon_args: '-D' + ensure: running + enable: true + pidfile: /run/mgmt.pid + params: {} + + + files: + config: + path: '/etc/mgmt/mgmt.conf' + init: + path: '/etc/sysconfig/mgmt.conf' + format: 'inifile' + systemd: + path: '/etc/systemd/system/mgmt.service' + format: 'inifile_with_stanzas' + + dirs: + config: + path: '/etc/mgmt' + conf: + path: '/etc/mgmt/conf.d' + log: + path: /var/log/mgmt + home: + path: /var/lib/mgmt + + user_files: + config: + path: '$HOME/.mgmt/mgmt.conf' + + user_dirs: + config: + path: '$HOME/.mgmt' + + ports: + main: + port: 42 + protocol: tcp + ssl: + port: 4432 + protocol: tcp + + info_commands: + list: 'mgmt list' + debug_commands: + debug: 'mgmt debug' + test_commands: + status: 'mgmt status' + version_command: 'mgmt version' + help_command: 'mgmt help' + run_commands: + start: + command: 'mgmt start' + + build: + prerequisites: + tp::install: + - golang + execs: + - name: build + command: 'make' + setup: + enable: true + files: + mgmt: + path: '/usr/local/bin/mgmt' + mode: '0755' + systemd_options: {} + resources: {} + manage_service: false + manage_user: false + + release: + latest_version: '0.0.21-1' + prerequisites: {} + latest_url: ~ + base_url: 'https://github.com/purpleidea/mgmt/releases' + file_name: 'mgmt-$VERSION.$OS-$ARCH.tar.gz' + extracted_dir: 'mgmt-$VERSION.$OS-$ARCH' + file_format: tar.gz + setup: + enable: true + files: + mgmt: + path: '/usr/local/bin/mgmt' + mode: '0755' + systemd_options: + Service: + ExecStart: '/usr/local/bin/mgmt run empty' + EnvironmentFile: ~ + resources: {} + manage_service: false + manage_user: false diff --git a/data/mgmt/hiera.yaml b/data/mgmt/hiera.yaml new file mode 100644 index 00000000..b2a2fa6a --- /dev/null +++ b/data/mgmt/hiera.yaml @@ -0,0 +1,15 @@ +--- +:hierarchy: + - "%{title}/%{repo}/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/%{repo}/operatingsystem/%{operatingsystem}" + - "%{title}/%{repo}/osfamily/%{osfamily}%{operatingsystemmajrelease}" + - "%{title}/%{repo}/osfamily/%{osfamily}" + - "%{title}/%{repo}/default" + - "%{title}/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/operatingsystem/%{operatingsystem}" + - "%{title}/osfamily/%{osfamily}%{operatingsystemmajrelease}" + - "%{title}/osfamily/%{osfamily}" + - "%{title}/default" + - "default/%{operatingsystem}%{operatingsystemmajrelease}" + - "default/%{operatingsystem}" + - default diff --git a/data/mgmt/osfamily/Darwin.yaml b/data/mgmt/osfamily/Darwin.yaml new file mode 100644 index 00000000..041afadc --- /dev/null +++ b/data/mgmt/osfamily/Darwin.yaml @@ -0,0 +1,11 @@ +--- +mgmt::settings: + brew_package_name: 'mgmt' + + user_files: + config: + path: '$HOME/Library/Application\ Support/mgmt/mgmt.conf' + + user_dirs: + config: + path: '$HOME/Library/Application\ Support/mgmt/mgmt.conf' \ No newline at end of file diff --git a/data/mgmt/osfamily/Debian.yaml b/data/mgmt/osfamily/Debian.yaml new file mode 100644 index 00000000..6542483e --- /dev/null +++ b/data/mgmt/osfamily/Debian.yaml @@ -0,0 +1,6 @@ +--- +mgmt::settings: + + files: + init: + path: '/etc/default/mgmt' \ No newline at end of file diff --git a/data/mgmt/osfamily/RedHat.yaml b/data/mgmt/osfamily/RedHat.yaml new file mode 100644 index 00000000..38eac048 --- /dev/null +++ b/data/mgmt/osfamily/RedHat.yaml @@ -0,0 +1,3 @@ +--- +mgmt::settings: + dockerfile_prerequisites: 'RUN yum install -y wget which' diff --git a/data/mgmt/osfamily/windows.yaml b/data/mgmt/osfamily/windows.yaml new file mode 100644 index 00000000..63713036 --- /dev/null +++ b/data/mgmt/osfamily/windows.yaml @@ -0,0 +1,14 @@ +--- +mgmt::settings: + + # If exe or msi package is available for direct download: + package_provider: 'windows' + package_source: 'https://github.com/mgmt/mgmt/releases/download/v$VERSION/mgmt_$VERSION_$OS_$ARCH.msi' + + user_files: + config: + path: '%APPDATA%\mgmt\mgmt.conf' + + user_dirs: + config: + path: '%APPDATA%\mgmt' \ No newline at end of file From 234278ae2c12b6fb397665fdd3068527b134025f Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 15 Feb 2023 18:52:39 +0100 Subject: [PATCH 19/27] Data for blender #65 --- data/blender/default.yaml | 72 ++++++++++++++++++++++++++++++ data/blender/hiera.yaml | 15 +++++++ data/blender/osfamily/Darwin.yaml | 8 ++++ data/blender/osfamily/Debian.yaml | 3 ++ data/blender/osfamily/windows.yaml | 4 ++ 5 files changed, 102 insertions(+) create mode 100644 data/blender/default.yaml create mode 100644 data/blender/hiera.yaml create mode 100644 data/blender/osfamily/Darwin.yaml create mode 100644 data/blender/osfamily/Debian.yaml create mode 100644 data/blender/osfamily/windows.yaml diff --git a/data/blender/default.yaml b/data/blender/default.yaml new file mode 100644 index 00000000..e668bcc1 --- /dev/null +++ b/data/blender/default.yaml @@ -0,0 +1,72 @@ +--- +blender::settings: + tp_prerequisites: {} + + urls: + website: 'https://blender.org' + support: 'https://www.blender.org/support/' + documentation: 'https://www.blender.org/get-involved/documentation/' + source: 'https://github.com/blender/blender' + description: 'Blender is the free and open source 3D creation suite' + + # Configured: +package -source -release +image + install_method: 'release' + + packages: + main: + name: blender + ensure: present + source: ~ + install_options: [] + params: {} + providers: + chocolatey: + name: + scoop: + name: blender + winget: + name: BlenderFoundation.Blender + + files: + config: + path: /usr/share/blender/$MAJVERSION/ + format: 'inifile_with_stanzas' + + dirs: + home: + path: /usr/share/blender/qON/ + + user_files: + config: + path: '$HOME/.config/blender/$MAJVERSION/' + + user_dirs: + config: + path: '$HOME/.config/blender/$MAJVERSION/' + + info_commands: + list: 'blender list' + debug_commands: + debug: 'blender debug' + test_commands: + status: 'blender status' + version_command: 'blender version' + help_command: 'blender help' + run_commands: + start: + command: 'blender start' + release: + latest_version: '3.4.1' + latest_version_major: '3.4' + destination: /usr/share/blender + base_url: 'https://mirrors.dotsrc.org/blender/release/Blender$MAJVERSION/' +# Official base url has a intermediate page. A specific mirrot is used instead. +# base_url: 'https://www.blender.org/download/release/Blender$MAJVERSION/blender-$VERSION-$OS-$ARCH' + file_name: 'blender-$VERSION-$OS-x64.tar.xz' + extracted_dir: 'blender-$VERSION-$OS-x64' + file_format: xz + extract_dir: '/usr/share/blender' + setup: + enable: true + links: + '/usr/local/bin/blender': '/usr/share/blender/blender-$VERSION-$OS-x64/blender' diff --git a/data/blender/hiera.yaml b/data/blender/hiera.yaml new file mode 100644 index 00000000..b2a2fa6a --- /dev/null +++ b/data/blender/hiera.yaml @@ -0,0 +1,15 @@ +--- +:hierarchy: + - "%{title}/%{repo}/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/%{repo}/operatingsystem/%{operatingsystem}" + - "%{title}/%{repo}/osfamily/%{osfamily}%{operatingsystemmajrelease}" + - "%{title}/%{repo}/osfamily/%{osfamily}" + - "%{title}/%{repo}/default" + - "%{title}/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/operatingsystem/%{operatingsystem}" + - "%{title}/osfamily/%{osfamily}%{operatingsystemmajrelease}" + - "%{title}/osfamily/%{osfamily}" + - "%{title}/default" + - "default/%{operatingsystem}%{operatingsystemmajrelease}" + - "default/%{operatingsystem}" + - default diff --git a/data/blender/osfamily/Darwin.yaml b/data/blender/osfamily/Darwin.yaml new file mode 100644 index 00000000..0d94cd8f --- /dev/null +++ b/data/blender/osfamily/Darwin.yaml @@ -0,0 +1,8 @@ +--- +blender::settings: + brew_package_name: 'blender' + package_provider: 'appdmg' + + packages: + main: + source: 'https://ftp.nluug.nl/pub/graphics/blender/release/Blender$MAJVERSION/blender-$VERSION-macos-$ARCH.dmg' diff --git a/data/blender/osfamily/Debian.yaml b/data/blender/osfamily/Debian.yaml new file mode 100644 index 00000000..0436a448 --- /dev/null +++ b/data/blender/osfamily/Debian.yaml @@ -0,0 +1,3 @@ +--- +blender::settings: {} + diff --git a/data/blender/osfamily/windows.yaml b/data/blender/osfamily/windows.yaml new file mode 100644 index 00000000..cb0137d9 --- /dev/null +++ b/data/blender/osfamily/windows.yaml @@ -0,0 +1,4 @@ +--- +blender::settings: + package_provider: 'windows' + package_source: 'https://www.blender.org/download/release/Blender$MAJVERSION/blender-$VERSION-windows-x64.msi' From 83c0370b99ac7cd8f899f22d517405714037c445 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 15 Feb 2023 19:29:57 +0100 Subject: [PATCH 20/27] Data for icinga_repo #72 --- data/icinga_repo/default.yaml | 4 ++++ data/icinga_repo/hiera.yaml | 13 +++++++++++++ data/icinga_repo/upstream/default.yaml | 5 +++++ data/icinga_repo/upstream/operatingsystem/Ubuntu.ya | 4 ++++ data/icinga_repo/upstream/osfamily/Debian.yaml | 5 +++++ data/icinga_repo/upstream/osfamily/RedHat.yaml | 4 ++++ 6 files changed, 35 insertions(+) create mode 100644 data/icinga_repo/default.yaml create mode 100644 data/icinga_repo/hiera.yaml create mode 100644 data/icinga_repo/upstream/default.yaml create mode 100644 data/icinga_repo/upstream/operatingsystem/Ubuntu.ya create mode 100644 data/icinga_repo/upstream/osfamily/Debian.yaml create mode 100644 data/icinga_repo/upstream/osfamily/RedHat.yaml diff --git a/data/icinga_repo/default.yaml b/data/icinga_repo/default.yaml new file mode 100644 index 00000000..2c331962 --- /dev/null +++ b/data/icinga_repo/default.yaml @@ -0,0 +1,4 @@ +--- +icinga_repo::settings: + upstream_repo: true + git_source: https://github.com/Icinga/icinga2 \ No newline at end of file diff --git a/data/icinga_repo/hiera.yaml b/data/icinga_repo/hiera.yaml new file mode 100644 index 00000000..1ee1f61c --- /dev/null +++ b/data/icinga_repo/hiera.yaml @@ -0,0 +1,13 @@ +--- +:hierarchy: + - "%{title}/%{repo}/osfamily/%{osfamily}" + - "%{title}/%{repo}/default" + - "%{title}/upstream/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/upstream/operatingsystem/%{operatingsystem}" + - "%{title}/upstream/osfamily/%{osfamily}%{operatingsystemmajrelease}" + - "%{title}/upstream/osfamily/%{osfamily}" + - "%{title}/upstream/default" + - "%{title}/osfamily/%{osfamily}" + - "%{title}/default" + - "default/%{operatingsystem}" + - default diff --git a/data/icinga_repo/upstream/default.yaml b/data/icinga_repo/upstream/default.yaml new file mode 100644 index 00000000..5f80a5a0 --- /dev/null +++ b/data/icinga_repo/upstream/default.yaml @@ -0,0 +1,5 @@ +--- +icinga_repo::settings: + repo_filename: icinga + repo_description: 'Icinga repository' + key_url: https://packages.icinga.com/icinga.key \ No newline at end of file diff --git a/data/icinga_repo/upstream/operatingsystem/Ubuntu.ya b/data/icinga_repo/upstream/operatingsystem/Ubuntu.ya new file mode 100644 index 00000000..c53f05c3 --- /dev/null +++ b/data/icinga_repo/upstream/operatingsystem/Ubuntu.ya @@ -0,0 +1,4 @@ +--- +icinga_repo::settings: + repo_url: 'https://packages.icinga.com/ubuntu' + diff --git a/data/icinga_repo/upstream/osfamily/Debian.yaml b/data/icinga_repo/upstream/osfamily/Debian.yaml new file mode 100644 index 00000000..998cd3a9 --- /dev/null +++ b/data/icinga_repo/upstream/osfamily/Debian.yaml @@ -0,0 +1,5 @@ +--- +icinga_repo::settings: + repo_url: 'https://packages.icinga.com/debian' + apt_repos: 'main' + apt_release: 'stable' diff --git a/data/icinga_repo/upstream/osfamily/RedHat.yaml b/data/icinga_repo/upstream/osfamily/RedHat.yaml new file mode 100644 index 00000000..e5729aca --- /dev/null +++ b/data/icinga_repo/upstream/osfamily/RedHat.yaml @@ -0,0 +1,4 @@ +--- +icinga_repo::settings: + repo_file_url: 'https://packages.icinga.com/centos/ICINGA-release.repo' + From 792de9e5a2a72ce85720dea1d173eb6fd453270b Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 15 Feb 2023 19:38:25 +0100 Subject: [PATCH 21/27] Rename releases to release, service data and other refactor --- .github/ISSUE_TEMPLATE.md | 13 +-- data/default.yaml | 8 -- data/default/Devuan4.yaml | 4 - data/icinga2/default.yaml | 54 ++++++++--- data/nats-server/default.yaml | 4 +- data/nuclei/default.yaml | 4 +- data/nuclei/osfamily/windows.yaml | 2 +- data/prometheus/default.yaml | 12 ++- data/prometheus/osfamily/RedHat.yaml | 2 +- data/reference/default.yaml | 13 ++- data/sample/default.yaml | 139 +++++++++++++++------------ data/sample/osfamily/Darwin.yaml | 2 - data/sample/osfamily/Debian.yaml | 1 - data/sample/osfamily/windows.yaml | 9 -- data/sample/osfamily/windows11.yaml | 3 - data/sample/upstream/default.yaml | 6 -- data/spiderfoot/default.yaml | 2 +- scripts/convert_v3_to_v4.rb | 13 +-- 18 files changed, 153 insertions(+), 138 deletions(-) mode change 100644 => 100755 data/icinga2/default.yaml delete mode 100644 data/sample/osfamily/windows11.yaml delete mode 100644 data/sample/upstream/default.yaml mode change 100644 => 100755 scripts/convert_v3_to_v4.rb diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index db16f01c..154f8565 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,4 +1,8 @@ -# Describe your issue +# Your tp request + +Application to manage (new or to fix): +Operating System(s) to support: +Installation Method(s): ## Labels @@ -7,10 +11,3 @@ Please use the following labels: * **tinydata request** for any request for new or updated tinydata for an application * **questions** for any error you find, doubt or clarification request -## Context - -Please provide any info useful for troubleshooting, like: - -1. Output of `facter -p` on the failing node (at least the OS related facts) -2. Version of Puppet and of the module -3. The relevant Puppet code and eventually Hiera data diff --git a/data/default.yaml b/data/default.yaml index 226a0e37..fe1a0717 100644 --- a/data/default.yaml +++ b/data/default.yaml @@ -35,14 +35,6 @@ default::settings: ensure: present manage: false - services: - main: - process_user: root - process_group: root - ensure: running - enable: true - params: {} - files: config: owner: 'root' diff --git a/data/default/Devuan4.yaml b/data/default/Devuan4.yaml index 164acb26..5d4daed8 100644 --- a/data/default/Devuan4.yaml +++ b/data/default/Devuan4.yaml @@ -8,7 +8,3 @@ default::settings: default: apt: release: 'chimaera' - - services: - main: - provider: 'sysvinit' diff --git a/data/icinga2/default.yaml b/data/icinga2/default.yaml old mode 100644 new mode 100755 index d212dd9a..d1114757 --- a/data/icinga2/default.yaml +++ b/data/icinga2/default.yaml @@ -1,16 +1,42 @@ --- icinga2::settings: - package_name: 'icinga2' - service_name: 'icinga2' - config_file_path: '/etc/icinga2/icinga2.conf' - config_dir_path: '/etc/icinga2' - conf_dir_path: '/etc/icinga2/conf.d' - features_dir_path: '/etc/icinga2/features-enabled' - pid_file_path: '/var/run/icinga2/icinga2.pid' - log_file_path: - - '/var/log/icinga2/icinga2.log' - - '/var/log/icinga2/error.log' - log_dir_path: '/var/log/icinga2' - process_name: 'icinga2' - process_user: 'icinga' - process_group: 'icinga' + package_name: icinga2 + service_name: icinga2 + config_file_path: "/etc/icinga2/icinga2.conf" + config_dir_path: "/etc/icinga2" + conf_dir_path: "/etc/icinga2/conf.d" + features_dir_path: "/etc/icinga2/features-enabled" + pid_file_path: "/var/run/icinga2/icinga2.pid" + log_file_path: &1 + - "/var/log/icinga2/icinga2.log" + - "/var/log/icinga2/error.log" + log_dir_path: "/var/log/icinga2" + process_name: icinga2 + process_user: icinga + process_group: icinga + packages: + main: + name: icinga2 + services: + icinga2: + process_name: icinga2 + process_user: icinga + process_group: icinga + files: + config: + path: "/etc/icinga2/icinga2.conf" + log: + path: *1 + user_files: + config: + path: "$HOME/.icinga2/icinga2.conf" + dirs: + config: + path: "/etc/icinga2" + conf: + path: "/etc/icinga2/conf.d" + log: + path: "/var/log/icinga2" + user_dirs: + config: + path: "$HOME/.icinga2" diff --git a/data/nats-server/default.yaml b/data/nats-server/default.yaml index 4530a941..14ddd710 100644 --- a/data/nats-server/default.yaml +++ b/data/nats-server/default.yaml @@ -12,7 +12,7 @@ nats-server::settings: config_dir_path: '/etc/nats' # tp 4 settings - install_method: 'file' + install_method: 'release' description: 'NATS is an open-source, high-performance, cloud native messaging system.' docker_image: 'nats' docker_args: '' @@ -58,7 +58,7 @@ nats-server::settings: - name: build command: 'GO111MODULE=on go get github.com/nats-io/nats-server/v2' - releases: + release: latest_version: '2.9.11' prerequisites: {} base_url: 'https://github.com/nats-io/nats-server/releases/download/v$VERSION' diff --git a/data/nuclei/default.yaml b/data/nuclei/default.yaml index f5f77628..76b600c2 100644 --- a/data/nuclei/default.yaml +++ b/data/nuclei/default.yaml @@ -10,7 +10,7 @@ nuclei::settings: config_dir_path: '$HOME/.config/nuclei' # tp 4 settings - install_method: 'file' + install_method: 'release' description: 'Fast and customizable vulnerability scanner based on simple YAML based DSL.' docker_image: 'projectdiscovery/nuclei' docker_args: '' @@ -76,7 +76,7 @@ nuclei::settings: - name: build command: 'go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest' - releases: + release: latest_version: '2.8.6' prerequisites: {} base_url: 'https://github.com/projectdiscovery/nuclei/releases/download/v$VERSION' diff --git a/data/nuclei/osfamily/windows.yaml b/data/nuclei/osfamily/windows.yaml index 9e89609f..57ff8111 100644 --- a/data/nuclei/osfamily/windows.yaml +++ b/data/nuclei/osfamily/windows.yaml @@ -1,3 +1,3 @@ --- nuclei::settings: - install_method: 'file' + install_method: 'release' diff --git a/data/prometheus/default.yaml b/data/prometheus/default.yaml index cb420c06..8e10b076 100644 --- a/data/prometheus/default.yaml +++ b/data/prometheus/default.yaml @@ -21,7 +21,7 @@ prometheus::settings: # tp 4 settings - install_method: 'file' + install_method: 'release' description: 'The Prometheus monitoring system and time series database' website: 'https://prometheus.io/' issues: 'https://github.com/prometheus/prometheus/issues' @@ -89,7 +89,7 @@ prometheus::settings: restart: command: 'prometheus restart' - releases: + release: latest_version: '2.41.0' prerequisites: {} base_url: 'https://github.com/prometheus/prometheus/releases/download/v$VERSION' @@ -97,13 +97,17 @@ prometheus::settings: extracted_dir: 'prometheus-$VERSION.$OS-$ARCH' file_format: 'tar.gz' checksum_url: 'https://github.com/prometheus/prometheus/releases/download/$VERSION/sha256sums.txt' + setup: + enable: true + manage_service: true + manage_user: true image: name: 'prom/prometheus' systemd_options: {} setup: - enable: true + enable: false files: prometheus: path: '/usr/local/bin/prometheus' @@ -132,8 +136,6 @@ prometheus::settings: Service: ExecStart: '/usr/local/bin/prometheus --config.file /etc/prometheus/prometheus.yml' WorkingDirectory: '/var/lib/prometheus' - manage_service: true - manage_user: true build: enable: false diff --git a/data/prometheus/osfamily/RedHat.yaml b/data/prometheus/osfamily/RedHat.yaml index 728c3e07..a4a99454 100644 --- a/data/prometheus/osfamily/RedHat.yaml +++ b/data/prometheus/osfamily/RedHat.yaml @@ -1,4 +1,4 @@ --- prometheus::settings: dockerfile_prerequisites: 'RUN yum install -y wget which' - install_method: 'file' + install_method: 'release' diff --git a/data/reference/default.yaml b/data/reference/default.yaml index a09643fb..3927c3e1 100644 --- a/data/reference/default.yaml +++ b/data/reference/default.yaml @@ -92,7 +92,7 @@ reference::settings: # which automatically replaces the following variables in the string: # $OS with downcase($facts['kernel']) # $ARCH with $facts['os']['architecture'] (with some mapping to match GitHub default names of archs) - # $VERSION with the version of the package (if set via $ensure, $version or in $settings.releases.latest_version) + # $VERSION with the version of the package (if set via $ensure, $version or in $settings.release.latest_version) # For example, this could be: # package_source: 'https://github.com/reference/reference/releases/download/v$VERSION/reference_$VERSION_$OS_$ARCH.msi' # This works only with Puppet providers that accept a source argument @@ -458,9 +458,12 @@ reference::settings: # The init system to use for the app. (Set in default settings, usually no need to override) init_system: ~ + # The service provider to use + service_provider: ~ + + # Services to manage services: - main: - name: reference + reference: process_name: reference process_extra_name: ~ process_user: root @@ -719,7 +722,7 @@ reference::settings: # A v4 setting used by the tp::install define to install the app when install_method=file - releases: + : # An hash of Puppet resources (file, exec, package, tp::install ... any Puppet resource type can be used) # to apply before installing the app with install_method=file . The values of each resource can be a string, # an array or an hash of resource titles with the relevant arguments @@ -773,7 +776,7 @@ reference::settings: manage_service: true manage_user: false - # The default setup settings. They are merged with settings.releases.setup and settings.source.setup + # The default setup settings. They are merged with settings.$install_method.setup setup: # If to enable the setup, which involves doing the configurations as defined in the other settings enable: false diff --git a/data/sample/default.yaml b/data/sample/default.yaml index 1db1fe8c..b295deda 100644 --- a/data/sample/default.yaml +++ b/data/sample/default.yaml @@ -2,31 +2,48 @@ sample::settings: tp_prerequisites: {} - upstream_repo: false - package_name: 'sample' - service_name: 'sample' - process_name: 'sample' - process_user: 'root' - process_group: 'root' - config_file_path: '/etc/sample/sample.conf' - config_file_format: yaml - # validate_cmd: 'sample validate' - pid_file_path: '/run/sample.pid' - init_file_path: '/etc/sysconfig/sample.conf' - log_file_path: - - '/var/log/sample/sample.log' - config_dir_path: '/etc/sample' - log_dir_path: - - '/var/log/sample' + urls: + website: 'https://sample.com' + issues: 'https://github.com/sample/sample/issues' + documentation: 'https://sample.com/documentation' + source: 'https://github.com/sample/sample' + description: 'sample description' - # tp 4 settings + # Configured: +package -source -file +image install_method: 'package' - description: 'sample description' - docker_image: 'sample/sample' - docker_args: '' - website: 'https://sample.com' - issues: 'https://github.com/sample/sample/issues' - git_source: 'https://github.com/sample/sample' + + packages: + main: + name: sample + ensure: present + source: ~ + install_options: [] + params: {} + providers: + chocolatey: + name: ~ + scoop: + name: ~ + winget: + name: ~ + # Examples of other packages + client: + name: sample-client + server: + name: sample-server + + services: + sample: + process_name: sample + process_extra_name: ~ + process_user: root + process_group: root + nodaemon_args: '-D' + ensure: running + enable: true + pidfile: /run/sample.pid + params: {} + files: config: @@ -64,29 +81,23 @@ sample::settings: port: 4432 protocol: tcp - commandsTOCONF: - info: - list: 'sample list' - debug: - debug: 'sample debug' - test: + info_commands: + list: 'sample list' + debug_commands: + debug: 'sample debug' + test_commands: status: 'sample status' - version: 'sample --version' - run: - start: - command: 'sample start' - arguments: - - 'instance': - default: '' - description: 'Instance to start' - options: - config_file: - default: 'sample.conf' - value: String - description: 'Config file to use' - restart: - command: 'sample restart' + version_command: 'sample version' + help_command: 'sample help' + run_commands: + start: + command: 'sample start' + image: + name: 'sample/sample' + ports: + - 9090:9090 + systemd_options: {} build: prerequisites: @@ -99,8 +110,18 @@ sample::settings: command: 'make' - name: setup command: 'make install' + setup: + enable: true + files: + sample: + path: '/usr/local/bin/sample' + mode: '0755' + systemd_options: {} + resources: {} + manage_service: false + manage_user: false - releases: + release: latest_version: ~ prerequisites: {} latest_url: ~ @@ -108,18 +129,16 @@ sample::settings: file_name: 'sample-$VERSION.$OS-$ARCH.tar.gz' extracted_dir: 'sample-$VERSION.$OS-$ARCH' file_format: tar.gz - - setup: - enable: true - files: - sample: - path: '/usr/local/bin/sample' - mode: '0755' - systemd_options: - Service: - ExecStart: '/var/lib/tp/source/sample/sample -l 127.0.0.1' - EnvironmentFile: ~ - resources: {} - manage_service: true - manage_user: false - + setup: + enable: true + files: + sample: + path: '/usr/local/bin/sample' + mode: '0755' + systemd_options: + Service: + ExecStart: '/var/lib/tp/source/sample/sample -l 127.0.0.1' + EnvironmentFile: ~ + resources: {} + manage_service: false + manage_user: false diff --git a/data/sample/osfamily/Darwin.yaml b/data/sample/osfamily/Darwin.yaml index cd51e27e..73ba7d0a 100644 --- a/data/sample/osfamily/Darwin.yaml +++ b/data/sample/osfamily/Darwin.yaml @@ -1,8 +1,6 @@ --- sample::settings: brew_package_name: 'sample' - user_config_file_path: '$HOME/Library/Application\ Support/sample/sample.conf' - user_config_dir_path: '$HOME/Library/Application\ Support/sample/' user_files: config: diff --git a/data/sample/osfamily/Debian.yaml b/data/sample/osfamily/Debian.yaml index cda87d49..8c6299cf 100644 --- a/data/sample/osfamily/Debian.yaml +++ b/data/sample/osfamily/Debian.yaml @@ -1,6 +1,5 @@ --- sample::settings: - init_file_path: '/etc/default/sample' files: init: diff --git a/data/sample/osfamily/windows.yaml b/data/sample/osfamily/windows.yaml index 18eaff30..9098e8bf 100644 --- a/data/sample/osfamily/windows.yaml +++ b/data/sample/osfamily/windows.yaml @@ -1,14 +1,5 @@ --- sample::settings: - winget_package_name: 'sample.sample' - choco_package_name: 'sample' - package_name: 'sample' - config_file_path: 'C:\ProgramData\sample\sample\etc\sample.conf' - config_dir_path: 'C:\ProgramData\sample\sample\etc' - process_user: 'LocalSystem' - process_group: 'LocalSystem' - user_config_file_path: '%APPDATA%\sample\sample.conf' - user_config_dir_path: '%APPDATA%\sample' # If exe or msi package is available for direct download: package_provider: 'windows' diff --git a/data/sample/osfamily/windows11.yaml b/data/sample/osfamily/windows11.yaml deleted file mode 100644 index 0a50fef1..00000000 --- a/data/sample/osfamily/windows11.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -sample::settings: - package_name: 'sample.sample' diff --git a/data/sample/upstream/default.yaml b/data/sample/upstream/default.yaml deleted file mode 100644 index 998a7c92..00000000 --- a/data/sample/upstream/default.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -sample::settings: {} - -# tp_prerequisites: -# sample_repo: {} - diff --git a/data/spiderfoot/default.yaml b/data/spiderfoot/default.yaml index d1e34419..19df682b 100644 --- a/data/spiderfoot/default.yaml +++ b/data/spiderfoot/default.yaml @@ -34,7 +34,7 @@ spiderfoot::settings: install_method: 'source' - releases: + release: latest_version: '4.0' prerequisites: {} latest: {} diff --git a/scripts/convert_v3_to_v4.rb b/scripts/convert_v3_to_v4.rb old mode 100644 new mode 100755 index 0ba6c620..6d6c54fb --- a/scripts/convert_v3_to_v4.rb +++ b/scripts/convert_v3_to_v4.rb @@ -1,3 +1,4 @@ +#!/opt/puppetlabs/puppet/bin/ruby require 'yaml' # This script converts a v3 config file to a v4 config file @@ -29,22 +30,22 @@ # Get the service name from the original config service_name = original_config[settings_key]['service_name'] -original_config[settings_key]["services"] = {"main" => {"name" => service_name}} if service_name +original_config[settings_key]["services"][service_name] if service_name # Get the process name from the original config process_name = original_config[settings_key]['process_name'] -original_config[settings_key]["services"]["main"]["process_name"] = process_name if process_name +original_config[settings_key]["services"][service_name]["process_name"] = process_name if process_name # Get the process_extra name from the original config process_extra_name = original_config[settings_key]['process_extra_name'] -original_config[settings_key]["services"]["main"]["process_extra_name"] = process_extra_name if process_extra_name +original_config[settings_key]["services"][service_name]["process_extra_name"] = process_extra_name if process_extra_name # Get the process user from the original config process_user = original_config[settings_key]['process_user'] -original_config[settings_key]["services"]["main"]["process_user"] = process_user if process_user +original_config[settings_key]["services"][service_name]["process_user"] = process_user if process_user # Get the process group from the original config process_group = original_config[settings_key]['process_group'] -original_config[settings_key]["services"]["main"]["process_group"] = process_user if process_group +original_config[settings_key]["services"][service_name]["process_group"] = process_user if process_group # Get the process nodaemon_args from the original config nodaemon_args = original_config[settings_key]['nodaemon_args'] -original_config[settings_key]["services"] = {"main" => {"nodaemon_args" => nodaemon_args}} if nodaemon_args +original_config[settings_key]["services"][service_name]["nodaemon_args"] = nodaemon_args if nodaemon_args # Get the config_file_path from the original config From 9859be30fa3780ad5e1c5dac1624d62bac1656e3 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Thu, 16 Feb 2023 18:30:10 +0100 Subject: [PATCH 22/27] Nix fix --- data/nix/default.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/nix/default.yaml b/data/nix/default.yaml index 97cc3953..b491ba7f 100644 --- a/data/nix/default.yaml +++ b/data/nix/default.yaml @@ -4,9 +4,11 @@ nix::settings: exec_prerequisites: install: # command: 'sh <(curl -L https://nixos.org/nix/install) --daemon' - command: 'curl -L https://nixos.org/nix/install -o /tmp/nix_install ; sh /tmp/nix_install --daemon | yes' +# command: 'curl -L https://nixos.org/nix/install -o /tmp/nix_install ; sh /tmp/nix_install --daemon | yes' + command: 'wget -O /tmp/nix_install https://nixos.org/nix/install ; sh /tmp/nix_install --daemon --yes' creates: '/nix' provider: posix + environment: [ 'HOME=/root' ] urls: website: 'https://nixos.org' From 34ba37f4dcf79743c740ca3d62289a8c9d4e875d Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 9 Aug 2023 20:22:53 +0200 Subject: [PATCH 23/27] Removed snmpd. Other fixes --- .rspec | 2 +- data/crowdsec_repo/upstream/default.yaml | 2 +- data/default.yaml | 11 +- data/fail2ban/osfamily/RedHat.yaml | 4 + data/reference/hiera.yaml | 6 +- data/snmp/default.yaml | 178 ++++++++++++++++++++- data/snmp/hiera.yaml | 9 ++ data/snmp/osfamily/Darwin.yaml | 11 ++ data/snmp/osfamily/Debian.yaml | 24 ++- data/{snmpd => snmp}/osfamily/OpenBSD.yaml | 2 +- data/snmp/osfamily/RedHat.yaml | 13 +- data/snmp/osfamily/Solaris.yaml | 5 + data/snmp/osfamily/Suse.yaml | 3 - data/snmp/osfamily/Ubuntu.yaml | 4 - data/snmp/osfamily/windows.yaml | 14 ++ data/snmpd/default.yaml | 13 -- data/snmpd/hiera.yaml | 6 - data/snmpd/osfamily/Debian.yaml | 7 - data/snmpd/osfamily/RedHat.yaml | 5 - data/snmpd/osfamily/Solaris.yaml | 8 - data/snmpd/osfamily/Suse.yaml | 3 - metadata.json | 2 +- scripts/github_latest_version.py | 21 +++ scripts/github_repos.txt | 34 ++++ 24 files changed, 318 insertions(+), 69 deletions(-) create mode 100644 data/fail2ban/osfamily/RedHat.yaml create mode 100644 data/snmp/osfamily/Darwin.yaml rename data/{snmpd => snmp}/osfamily/OpenBSD.yaml (88%) delete mode 100644 data/snmp/osfamily/Suse.yaml delete mode 100644 data/snmp/osfamily/Ubuntu.yaml create mode 100644 data/snmp/osfamily/windows.yaml delete mode 100644 data/snmpd/default.yaml delete mode 100644 data/snmpd/hiera.yaml delete mode 100644 data/snmpd/osfamily/Debian.yaml delete mode 100644 data/snmpd/osfamily/RedHat.yaml delete mode 100644 data/snmpd/osfamily/Solaris.yaml delete mode 100644 data/snmpd/osfamily/Suse.yaml create mode 100755 scripts/github_latest_version.py create mode 100644 scripts/github_repos.txt diff --git a/.rspec b/.rspec index 16f9cdb0..5f164763 100644 --- a/.rspec +++ b/.rspec @@ -1,2 +1,2 @@ --color ---format documentation +--format progress diff --git a/data/crowdsec_repo/upstream/default.yaml b/data/crowdsec_repo/upstream/default.yaml index 774c6221..61ef3b1e 100644 --- a/data/crowdsec_repo/upstream/default.yaml +++ b/data/crowdsec_repo/upstream/default.yaml @@ -1,6 +1,6 @@ --- crowdsec_repo::settings: - key_url: https://packagecloud.io/crowdsec/crowdsec/gpgkey + key_url: https://packagecloud.io/crowdsec/crowdsec/gpgkey https://packagecloud.io/crowdsec/crowdsec/gpgkey/crowdsec-crowdsec-B78D1222C9AD2D5D.pub.gpg https://packagecloud.io/crowdsec/crowdsec/gpgkey/crowdsec-crowdsec-EDE2C695EC9A5A5C.pub.gpg https://packagecloud.io/crowdsec/crowdsec/gpgkey/crowdsec-crowdsec-C822EDD6B39954A1.pub.gpg https://packagecloud.io/crowdsec/crowdsec/gpgkey/crowdsec-crowdsec-FED78314A2468CCF.pub.gpg key: '6A89 E3C2 303A 901A 8899 71D3 376E D532 6E93 CD0C' apt_repos: 'main' repo_filename: crowdsec_crowdsec diff --git a/data/default.yaml b/data/default.yaml index fe1a0717..ca1ab56d 100644 --- a/data/default.yaml +++ b/data/default.yaml @@ -9,19 +9,12 @@ default::settings: config_file_mode: '0644' config_dir_owner: 'root' config_dir_group: 'root' - config_dir_mode: '0755' + config_dir_mode: '0644' config_dir_purge: false - config_dir_recurse: true + config_dir_recurse: false install_method: 'package' packages: - main: - ensure: present - source: ~ - install_options: [] - params: {} - providers: {} - manage: true devel: name: '$TITLE-devel' ensure: present diff --git a/data/fail2ban/osfamily/RedHat.yaml b/data/fail2ban/osfamily/RedHat.yaml new file mode 100644 index 00000000..c6062fc8 --- /dev/null +++ b/data/fail2ban/osfamily/RedHat.yaml @@ -0,0 +1,4 @@ +--- +fail2ban::settings: + tp_prerequisites: + - epel diff --git a/data/reference/hiera.yaml b/data/reference/hiera.yaml index fcd4bfdc..77ac7154 100644 --- a/data/reference/hiera.yaml +++ b/data/reference/hiera.yaml @@ -1,7 +1,7 @@ -# This file defines the hierathy to follow when looking for tinydata settings -# Note that even if it's called like a normal Hiera 3 configuration files +# This file defines the hierarchy to follow when looking for tinydata settings +# Note that even if it looks like a normal Hiera 3 configuration files # and has a similar logic it's NOT a Hiera configuration and is not used by Hiera -# This file is actually used by the tp_slookuo function and has the following +# This file is actually used by the tp_lookup function and has the following # limitation: # Variables interpolation is done ONLY for the following variables: # - Fact $::operatingsystemmajrelease diff --git a/data/snmp/default.yaml b/data/snmp/default.yaml index 0cdf07d2..33d2da23 100644 --- a/data/snmp/default.yaml +++ b/data/snmp/default.yaml @@ -1,3 +1,179 @@ --- snmp::settings: - package_name: 'snmp' + tp_prerequisites: {} + + package_name: 'snmpd' + service_name: 'snmpd' + config_file_path: '/etc/snmp/snmpd.conf' + config_file_mode: '0600' + config_dir_path: '/etc/snmp' + pid_file_path: '/var/run/snmpd.pid' + log_file_path: '/var/log/snmpd/snmpd.log' + log_dir_path: '/var/log/snmpd' + process_name: 'snmpd' + process_user: 'snmpd' + process_group: 'snmpd' + udp_port: '161' + + urls: + website: 'http://www.net-snmp.org/' + issues: 'https://github.com/net-snmp/net-snmp/issues' + documentation: 'https://snmpd.com/documentation' + source: 'https://github.com/net-snmp/net-snmp' + description: 'A SNMP application library, tools and daemon' + + # Configured: +package -source -file +image + install_method: 'package' + + packages: + main: + name: snmpd + ensure: present + source: ~ + install_options: [] + params: {} + providers: + chocolatey: + name: ~ + scoop: + name: ~ + winget: + name: ~ + snmptrapd: + name: snmptrapd + ensure: present + source: ~ + install_options: [] + params: {} + providers: + chocolatey: + name: ~ + scoop: + name: ~ + winget: + name: ~ + services: + snmpd: + process_name: snmpd + process_extra_name: ~ + process_user: root + process_group: root + nodaemon_args: '-D' + ensure: running + enable: true + pidfile: /var/run/snmpd.pid + params: {} + snmptrapd: + process_name: snmptrapd + process_extra_name: ~ + process_user: root + process_group: root + nodaemon_args: '-D' + ensure: stopped + enable: false + pidfile: /var/run/snmptrapd.pid + params: {} + + + files: + client: + path: '/etc/snmp/snmp.conf' + config: + path: '/etc/snmp/snmpd.conf' + mode: '0600' + init: + path: '/etc/sysconfig/snmpd' + format: 'inifile' + systemd: + path: '/etc/systemd/system/snmpd.service' + format: 'inifile_with_stanzas' + snmptrapd: + path: '/etc/snmp/snmptrapd.conf' + snmptrapd_init: + path: '/etc/sysconfig/snmptrapd' + format: 'inifile' + dirs: + config: + path: '/etc/snmp' + log: + path: /var/log/snmpd + home: + path: /var/lib/snmp + + user_files: + config: + path: '$HOME/.snmpd/snmpd.conf' + + user_dirs: + config: + path: '$HOME/.snmpd' + + ports: + main: + port: 42 + protocol: tcp + ssl: + port: 4432 + protocol: tcp + + info_commands: + list: 'snmpd list' + debug_commands: + debug: 'snmpd debug' + test_commands: + status: 'snmpd status' + version_command: 'snmpd version' + help_command: 'snmpd help' + run_commands: + start: + command: 'snmpd start' + + image: + name: 'snmpd/snmpd' + ports: + - 9090:9090 + systemd_options: {} + + build: + prerequisites: + tp::install: + - build-essential + execs: + - name: configure + command: './configure' + - name: build + command: 'make' + - name: setup + command: 'make install' + setup: + enable: true + files: + snmpd: + path: '/usr/local/bin/snmpd' + mode: '0755' + systemd_options: {} + resources: {} + manage_service: false + manage_user: false + + release: + latest_version: ~ + prerequisites: {} + latest_url: ~ + base_url: 'https://sourceforge.net/projects/net-snmp/files/net-snmp/$VERSION/' + file_name: 'net-snmp-$VERSION.tar.gz' + extracted_dir: 'net-snmp-$VERSION' + file_format: tar.gz + setup: + enable: true + files: + snmpd: + path: '/usr/local/bin/snmpd' + mode: '0755' + systemd_options: + Service: + ExecStart: '/var/lib/tp/source/snmpd/snmpd -l 127.0.0.1' + EnvironmentFile: ~ + resources: {} + manage_service: false + manage_user: false diff --git a/data/snmp/hiera.yaml b/data/snmp/hiera.yaml index 19fa9ae9..b2a2fa6a 100644 --- a/data/snmp/hiera.yaml +++ b/data/snmp/hiera.yaml @@ -1,6 +1,15 @@ --- :hierarchy: + - "%{title}/%{repo}/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/%{repo}/operatingsystem/%{operatingsystem}" + - "%{title}/%{repo}/osfamily/%{osfamily}%{operatingsystemmajrelease}" + - "%{title}/%{repo}/osfamily/%{osfamily}" + - "%{title}/%{repo}/default" + - "%{title}/operatingsystem/%{operatingsystem}%{operatingsystemmajrelease}" + - "%{title}/operatingsystem/%{operatingsystem}" + - "%{title}/osfamily/%{osfamily}%{operatingsystemmajrelease}" - "%{title}/osfamily/%{osfamily}" - "%{title}/default" + - "default/%{operatingsystem}%{operatingsystemmajrelease}" - "default/%{operatingsystem}" - default diff --git a/data/snmp/osfamily/Darwin.yaml b/data/snmp/osfamily/Darwin.yaml new file mode 100644 index 00000000..fa4f159b --- /dev/null +++ b/data/snmp/osfamily/Darwin.yaml @@ -0,0 +1,11 @@ +--- +snmp::settings: + brew_package_name: 'snmp' + + user_files: + config: + path: '$HOME/Library/Application\ Support/snmp/snmp.conf' + + user_dirs: + config: + path: '$HOME/Library/Application\ Support/snmp/snmp.conf' \ No newline at end of file diff --git a/data/snmp/osfamily/Debian.yaml b/data/snmp/osfamily/Debian.yaml index 040a3ed9..e5c83a39 100644 --- a/data/snmp/osfamily/Debian.yaml +++ b/data/snmp/osfamily/Debian.yaml @@ -1,4 +1,24 @@ --- snmp::settings: - config_file_path: '/etc/snmp/snmp.conf' - config_dir_path: '/etc/snmp/' + config_dir_path: '/etc/snmp' + process_user: 'snmp' + process_group: 'snmp' + init_file_path: '/etc/default/snmpd' + + files: + client: + path: '/etc/snmp/snmp.conf' + config: + path: '/etc/snmp/snmpd.conf' + mode: '0600' + init: + path: '/etc/default/snmpd' + format: 'inifile' + systemd: + path: '/etc/systemd/system/snmpd.service' + format: 'inifile_with_stanzas' + snmptrapd: + path: '/etc/snmp/snmptrapd.conf' + snmptrapd_init: + path: '/etc/default/snmptrapd' + format: 'inifile' \ No newline at end of file diff --git a/data/snmpd/osfamily/OpenBSD.yaml b/data/snmp/osfamily/OpenBSD.yaml similarity index 88% rename from data/snmpd/osfamily/OpenBSD.yaml rename to data/snmp/osfamily/OpenBSD.yaml index 84614119..3de51418 100644 --- a/data/snmpd/osfamily/OpenBSD.yaml +++ b/data/snmp/osfamily/OpenBSD.yaml @@ -1,5 +1,5 @@ --- -snmpd::settings: +snmp::settings: package_name: 'net-snmp' service_name: 'netsnmpd' config_file_path: '/etc/snmp/snmpd.conf' diff --git a/data/snmp/osfamily/RedHat.yaml b/data/snmp/osfamily/RedHat.yaml index 233bdd0e..2292d374 100644 --- a/data/snmp/osfamily/RedHat.yaml +++ b/data/snmp/osfamily/RedHat.yaml @@ -1,3 +1,14 @@ --- snmp::settings: - package_name: 'net-snmp-utils' + package_name: 'net-snmp' + config_file_mode: '0600' + init_file_path: '/etc/sysconfig/snmpd' + + + packages: + main: + name: net-snmp + + files: + init: + path: '/etc/sysconfig/snmpd' \ No newline at end of file diff --git a/data/snmp/osfamily/Solaris.yaml b/data/snmp/osfamily/Solaris.yaml index 7ae7ff58..ad4aa0b0 100644 --- a/data/snmp/osfamily/Solaris.yaml +++ b/data/snmp/osfamily/Solaris.yaml @@ -1,3 +1,8 @@ --- snmp::settings: package_name: 'net-snmp' + service_name: 'net-snmp' + config_file_path: '/etc/net-snmp/snmp/snmpd.conf' + config_file_mode: '0444' + config_file_group: 'bin' + config_dir_path: '/etc/net-snmp/snmp' diff --git a/data/snmp/osfamily/Suse.yaml b/data/snmp/osfamily/Suse.yaml deleted file mode 100644 index 233bdd0e..00000000 --- a/data/snmp/osfamily/Suse.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -snmp::settings: - package_name: 'net-snmp-utils' diff --git a/data/snmp/osfamily/Ubuntu.yaml b/data/snmp/osfamily/Ubuntu.yaml deleted file mode 100644 index 040a3ed9..00000000 --- a/data/snmp/osfamily/Ubuntu.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -snmp::settings: - config_file_path: '/etc/snmp/snmp.conf' - config_dir_path: '/etc/snmp/' diff --git a/data/snmp/osfamily/windows.yaml b/data/snmp/osfamily/windows.yaml new file mode 100644 index 00000000..7670fdad --- /dev/null +++ b/data/snmp/osfamily/windows.yaml @@ -0,0 +1,14 @@ +--- +snmp::settings: + + # If exe or msi package is available for direct download: + package_provider: 'windows' + package_source: 'https://github.com/snmp/snmp/releases/download/v$VERSION/snmp_$VERSION_$OS_$ARCH.msi' + + user_files: + config: + path: '%APPDATA%\snmp\snmp.conf' + + user_dirs: + config: + path: '%APPDATA%\snmp' \ No newline at end of file diff --git a/data/snmpd/default.yaml b/data/snmpd/default.yaml deleted file mode 100644 index 2db5d3af..00000000 --- a/data/snmpd/default.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -snmpd::settings: - package_name: 'snmpd' - service_name: 'snmpd' - config_file_path: '/etc/snmp/snmpd.conf' - config_dir_path: '/etc/snmp' - pid_file_path: '/var/run/snmpd.pid' - log_file_path: '/var/log/snmpd/snmpd.log' - log_dir_path: '/var/log/snmpd' - process_name: 'snmpd' - process_user: 'snmpd' - process_group: 'snmpd' - udp_port: '161' diff --git a/data/snmpd/hiera.yaml b/data/snmpd/hiera.yaml deleted file mode 100644 index 19fa9ae9..00000000 --- a/data/snmpd/hiera.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -:hierarchy: - - "%{title}/osfamily/%{osfamily}" - - "%{title}/default" - - "default/%{operatingsystem}" - - default diff --git a/data/snmpd/osfamily/Debian.yaml b/data/snmpd/osfamily/Debian.yaml deleted file mode 100644 index b8d448b7..00000000 --- a/data/snmpd/osfamily/Debian.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -snmpd::settings: - config_file_mode: '0600' - config_dir_path: '/etc/snmp' - process_user: 'snmp' - process_group: 'snmp' - init_file_path: '/etc/default/snmpd' diff --git a/data/snmpd/osfamily/RedHat.yaml b/data/snmpd/osfamily/RedHat.yaml deleted file mode 100644 index 91258695..00000000 --- a/data/snmpd/osfamily/RedHat.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -snmpd::settings: - package_name: 'net-snmp' - config_file_mode: '0600' - init_file_path: '/etc/sysconfig/snmpd.options' diff --git a/data/snmpd/osfamily/Solaris.yaml b/data/snmpd/osfamily/Solaris.yaml deleted file mode 100644 index c4dfe4b8..00000000 --- a/data/snmpd/osfamily/Solaris.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -snmpd::settings: - package_name: 'net-snmp' - service_name: 'net-snmp' - config_file_path: '/etc/net-snmp/snmp/snmpd.conf' - config_file_mode: '0444' - config_file_group: 'bin' - config_dir_path: '/etc/net-snmp/snmp' diff --git a/data/snmpd/osfamily/Suse.yaml b/data/snmpd/osfamily/Suse.yaml deleted file mode 100644 index 2e4c73f5..00000000 --- a/data/snmpd/osfamily/Suse.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -snmpd::settings: - package_name: 'net-snmp' diff --git a/metadata.json b/metadata.json index 8cf892ef..239bb77e 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "example42-tinydata", - "version": "0.6.0", + "version": "0.6.1", "author": "Alessandro Franceschi", "summary": "Tiny Puppet Data", "license": "Apache-2.0", diff --git a/scripts/github_latest_version.py b/scripts/github_latest_version.py new file mode 100755 index 00000000..0eaee125 --- /dev/null +++ b/scripts/github_latest_version.py @@ -0,0 +1,21 @@ +#!/usr/bin/python3 +import requests +import sys + +# Get the repo name from the first argument +repo = sys.argv[1] + +# Get the data file from the second argument +file = sys.argv[2] + +# Get the latest release version from Github API +url = "https://github.com/" + repo + "/releases/latest" +r = requests.get(url) +version = r.url.split('/')[-1] + +# Open the file in append mode +with open(file, "a") as f: + # Append a new line character at the end of file + f.write("\n") + # Append the version name to the file + f.write(version) diff --git a/scripts/github_repos.txt b/scripts/github_repos.txt new file mode 100644 index 00000000..bd4c9156 --- /dev/null +++ b/scripts/github_repos.txt @@ -0,0 +1,34 @@ + +elastic/beats/tree/master/auditbeat' +hashicorp/boundary' +PowerShell/PowerShell.git' +prometheus/prometheus' +ceph/ceph' +Icinga/icinga2 +example42/hdm' +vdukhovni/postfix' +microsoft/PowerToys.git' +LibreOffice/core' +apache/activemq' +pypa/pip' +nats-io/nats-server' +puppetlabs/bolt' +tigeli/bind-utils' +hashicorp/vault.git +telegramdesktop/tdesktop.git' +obsproject/obs-studio.git' +apache/httpd' +ansible/ansible' +microsoft/vscode' +projectdiscovery/nuclei' +microsoft/SCXcore.git' +Sysinternals/SysinternalsEBPF.git' +telegramdesktop/tdesktop.git' +Sysinternals/SysmonForLinux' +Sysinternals/ProcDump-for-Linux' +microsoft/omi.git' +git/git' +hashicorp/vagrant.git +telegramdesktop/tdesktop.git' +smicallef/spiderfoot' +Azure/azure-cli From cc72852713de497580b93cce1be0cc898ab7ad42 Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 9 Aug 2023 20:37:26 +0200 Subject: [PATCH 24/27] Version 0.7.0 --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 239bb77e..6ca28493 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "example42-tinydata", - "version": "0.6.1", + "version": "0.7.0", "author": "Alessandro Franceschi", "summary": "Tiny Puppet Data", "license": "Apache-2.0", From 3b98208109725ab085367bc571166f923da33d0b Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 9 Aug 2023 20:39:07 +0200 Subject: [PATCH 25/27] Yaml fix --- data/icinga2/default.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/icinga2/default.yaml b/data/icinga2/default.yaml index d1114757..b6f1ccb7 100755 --- a/data/icinga2/default.yaml +++ b/data/icinga2/default.yaml @@ -7,9 +7,9 @@ icinga2::settings: conf_dir_path: "/etc/icinga2/conf.d" features_dir_path: "/etc/icinga2/features-enabled" pid_file_path: "/var/run/icinga2/icinga2.pid" - log_file_path: &1 - - "/var/log/icinga2/icinga2.log" - - "/var/log/icinga2/error.log" + log_file_path: + - "/var/log/icinga2/icinga2.log" + - "/var/log/icinga2/error.log" log_dir_path: "/var/log/icinga2" process_name: icinga2 process_user: icinga From f4b1d5e818a198704a0b41d52db95f01d1cc36ad Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 9 Aug 2023 20:54:21 +0200 Subject: [PATCH 26/27] Lints --- data/blender/default.yaml | 10 +++++----- data/golang/default.yaml | 2 +- data/mgmt/default.yaml | 2 +- data/nix/default.yaml | 4 +--- data/reference/default.yaml | 2 +- data/sample/default.yaml | 2 +- data/snmp/default.yaml | 2 +- data/surfex/default.yaml | 1 - 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/data/blender/default.yaml b/data/blender/default.yaml index e668bcc1..51e47a8f 100644 --- a/data/blender/default.yaml +++ b/data/blender/default.yaml @@ -21,7 +21,7 @@ blender::settings: params: {} providers: chocolatey: - name: + name: blender scoop: name: blender winget: @@ -34,7 +34,7 @@ blender::settings: dirs: home: - path: /usr/share/blender/qON/ + path: '/usr/share/blender/qON/' user_files: config: @@ -49,7 +49,7 @@ blender::settings: debug_commands: debug: 'blender debug' test_commands: - status: 'blender status' + status: 'blender status' version_command: 'blender version' help_command: 'blender help' run_commands: @@ -60,8 +60,8 @@ blender::settings: latest_version_major: '3.4' destination: /usr/share/blender base_url: 'https://mirrors.dotsrc.org/blender/release/Blender$MAJVERSION/' -# Official base url has a intermediate page. A specific mirrot is used instead. -# base_url: 'https://www.blender.org/download/release/Blender$MAJVERSION/blender-$VERSION-$OS-$ARCH' + # Official base url has a intermediate page. A specific mirrot is used instead. + # base_url: 'https://www.blender.org/download/release/Blender$MAJVERSION/blender-$VERSION-$OS-$ARCH' file_name: 'blender-$VERSION-$OS-x64.tar.xz' extracted_dir: 'blender-$VERSION-$OS-x64' file_format: xz diff --git a/data/golang/default.yaml b/data/golang/default.yaml index 2b7d9bbc..ed6792e9 100644 --- a/data/golang/default.yaml +++ b/data/golang/default.yaml @@ -36,7 +36,7 @@ golang::settings: debug_commands: debug: 'go debug' test_commands: - status: 'go status' + status: 'go status' version_command: 'go version' help_command: 'go help' run_commands: diff --git a/data/mgmt/default.yaml b/data/mgmt/default.yaml index 050f736c..7df6ec7a 100644 --- a/data/mgmt/default.yaml +++ b/data/mgmt/default.yaml @@ -70,7 +70,7 @@ mgmt::settings: debug_commands: debug: 'mgmt debug' test_commands: - status: 'mgmt status' + status: 'mgmt status' version_command: 'mgmt version' help_command: 'mgmt help' run_commands: diff --git a/data/nix/default.yaml b/data/nix/default.yaml index b491ba7f..f26f44da 100644 --- a/data/nix/default.yaml +++ b/data/nix/default.yaml @@ -3,12 +3,10 @@ nix::settings: tp_prerequisites: {} exec_prerequisites: install: -# command: 'sh <(curl -L https://nixos.org/nix/install) --daemon' -# command: 'curl -L https://nixos.org/nix/install -o /tmp/nix_install ; sh /tmp/nix_install --daemon | yes' command: 'wget -O /tmp/nix_install https://nixos.org/nix/install ; sh /tmp/nix_install --daemon --yes' creates: '/nix' provider: posix - environment: [ 'HOME=/root' ] + environment: ['HOME=/root'] urls: website: 'https://nixos.org' diff --git a/data/reference/default.yaml b/data/reference/default.yaml index 3927c3e1..a9af6a33 100644 --- a/data/reference/default.yaml +++ b/data/reference/default.yaml @@ -722,7 +722,7 @@ reference::settings: # A v4 setting used by the tp::install define to install the app when install_method=file - : + releases: # An hash of Puppet resources (file, exec, package, tp::install ... any Puppet resource type can be used) # to apply before installing the app with install_method=file . The values of each resource can be a string, # an array or an hash of resource titles with the relevant arguments diff --git a/data/sample/default.yaml b/data/sample/default.yaml index b295deda..0f3cfc7b 100644 --- a/data/sample/default.yaml +++ b/data/sample/default.yaml @@ -86,7 +86,7 @@ sample::settings: debug_commands: debug: 'sample debug' test_commands: - status: 'sample status' + status: 'sample status' version_command: 'sample version' help_command: 'sample help' run_commands: diff --git a/data/snmp/default.yaml b/data/snmp/default.yaml index 33d2da23..ee9f03ce 100644 --- a/data/snmp/default.yaml +++ b/data/snmp/default.yaml @@ -121,7 +121,7 @@ snmp::settings: debug_commands: debug: 'snmpd debug' test_commands: - status: 'snmpd status' + status: 'snmpd status' version_command: 'snmpd version' help_command: 'snmpd help' run_commands: diff --git a/data/surfex/default.yaml b/data/surfex/default.yaml index 183573e7..c125d612 100644 --- a/data/surfex/default.yaml +++ b/data/surfex/default.yaml @@ -38,7 +38,6 @@ surfex::settings: base_url: 'https://www.umr-cnrm.fr/surfex/data/OPEN-SURFEX' file_name: 'open_surfex_$VERSION.tar.gz' extracted_dir: 'OPEN_SURFEX_V9' -# extracted_dir: 'open_SURFEX_V$MAJVERSION' file_format: tar.gz setup: enable: true From db7897e5dedee62eedbb855edd2483db6def475e Mon Sep 17 00:00:00 2001 From: Alessandro Franceschi Date: Wed, 9 Aug 2023 21:11:31 +0200 Subject: [PATCH 27/27] Lint --- data/nix/default.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/nix/default.yaml b/data/nix/default.yaml index f26f44da..44bd213d 100644 --- a/data/nix/default.yaml +++ b/data/nix/default.yaml @@ -65,7 +65,7 @@ nix::settings: debug_commands: debug: 'nix store verify' test_commands: - status: 'nix status' + status: 'nix status' version_command: 'nix --version' help_command: 'nix --help'