Skip to content

Commit

Permalink
Version 2.1.0
Browse files Browse the repository at this point in the history
  * !! changed parameter `salt::(master|minion|api|syndic)::package_release` to set latest, major or minor
  * added parameter `salt::(master|minion|api|syndic)::package_release_version` to specify version for major or minor releases
  • Loading branch information
JoelKle committed Nov 9, 2020
1 parent 25a9f5b commit e18b92a
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 22 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
#### Fixes


## 2.1.0 (November 09, 2020)

#### Features

* !! changed parameter `salt::(master|minion|api|syndic)::package_release` to set latest, major or minor
* added parameter `salt::(master|minion|api|syndic)::package_release_version` to specify version for major or minor releases


## 2.0.0 (May 06, 2020)

#### Features
Expand Down
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- [Manage Salt minion / master / api / syndic](#manage-salt-minion--master--api--syndic)
- [Basic setup](#basic-setup)
- [Install specific Salt version](#install-specific-salt-version)
- [Pin to Major release](#pin-to-major-release)
- [Pin to Minor release](#pin-to-minor-release)
- [Install additional packages needed for Salt](#install-additional-packages-needed-for-salt)
- [Manage Salt Pepper](#manage-salt-pepper)
- [Reference](#reference)
Expand Down Expand Up @@ -79,17 +81,28 @@ salt::master::config::create { 'append logging config':

#### Install specific Salt version

You can disable the management of the repo:
```yaml
salt::master::package_release: "2019.2.0"
salt::master::package_ensure: "%{lookup('salt::master::package_release')}+ds-1"
salt::master::repo_manage: false
```
* Installs the package repo for the release given with `salt::master::package_release`
* Installs the Salt master package in the version given with `salt::master::package_ensure`

You can disable the management of the repo:
##### Pin to Major release

```yaml
salt::master::repo_manage: false
salt::master::package_release: "major"
salt::master::package_release_version: "3002"
```
* Installs the package repo for the release given with `salt::master::package_release_version`

##### Pin to Minor release

```yaml
salt::master::package_release: "minor"
salt::master::package_release_version: "3002.1"
salt::master::package_ensure: "%{lookup('salt::master::package_release')}+ds-1"
```
* Installs the package repo for the release given with `salt::master::package_release_version`
* Installs the Salt master package in the version given with `salt::master::package_ensure`

#### Install additional packages needed for Salt

Expand Down
4 changes: 4 additions & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ salt::minion::package_manage: true
salt::minion::package_name: salt-minion
salt::minion::package_ensure: "%{lookup('salt::master::package_ensure')}"
salt::minion::package_release: "%{lookup('salt::master::package_release')}"
salt::minion::package_release_version: "%{lookup('salt::master::package_release_version')}"
salt::minion::additional_packages: ~
salt::minion::service_enable: true
salt::minion::service_ensure: running
Expand All @@ -41,6 +42,7 @@ salt::master::package_manage: true
salt::master::package_name: salt-master
salt::master::package_ensure: present
salt::master::package_release: latest
salt::master::package_release_version: ~
salt::master::additional_packages: ~
salt::master::service_enable: true
salt::master::service_ensure: running
Expand All @@ -54,6 +56,7 @@ salt::api::package_manage: true
salt::api::package_name: salt-api
salt::api::package_ensure: "%{lookup('salt::master::package_ensure')}"
salt::api::package_release: "%{lookup('salt::master::package_release')}"
salt::api::package_release_version: "%{lookup('salt::master::package_release_version')}"
salt::api::additional_packages:
- 'python3-cherrypy3'
salt::api::service_enable: true
Expand All @@ -68,6 +71,7 @@ salt::syndic::package_manage: true
salt::syndic::package_name: salt-syndic
salt::syndic::package_ensure: "%{lookup('salt::master::package_ensure')}"
salt::syndic::package_release: "%{lookup('salt::master::package_release')}"
salt::syndic::package_release_version: "%{lookup('salt::master::package_release_version')}"
salt::syndic::additional_packages: ~
salt::syndic::service_enable: true
salt::syndic::service_ensure: running
Expand Down
13 changes: 10 additions & 3 deletions manifests/api.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@
# Default: lookup('salt::master::package_ensure')
#
# @param package_release
# latest or any valid release. This variable is used for the repo url.
# latest, major or minor. This variable is used for the repo url.
# More infos here: [https://repo.saltstack.com/]
# Example: 2019.2.0 (To pin the repo url to a specific version)
# Default: lookup('salt::master::package_release')
#
# @param package_release_version
# Any valid release version.
# Only relevant if you set salt_release to major or minor!
# Example: 3002 (To pin the repo url to a major version)
# Example: 3002.1 (To pin the repo url to a minor version)
# Default: lookup('salt::master::package_release_version')
#
# @param additional_packages
# Any additional packages you want to install.
# More infos, what you can set here: [https://forge.puppet.com/puppetlabs/stdlib/5.2.0/readme#ensure_packages]
Expand Down Expand Up @@ -64,6 +70,7 @@
String[1] $package_name,
String $package_ensure,
String $package_release,
Optional[String] $package_release_version,
Optional[Variant[Array, Hash]] $additional_packages,
Boolean $service_enable,
Enum['stopped', 'running'] $service_ensure,
Expand All @@ -78,7 +85,7 @@
}

if $repo_manage {
ensure_resource('salt::repo', $package_release)
ensure_resource('salt::repo', $package_release, {'salt_release_version' => $package_release_version })
}

contain salt::api::install
Expand Down
13 changes: 10 additions & 3 deletions manifests/master.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@
# Default: present
#
# @param package_release
# latest or any valid release. This variable is used for the repo url.
# latest, major or minor. This variable is used for the repo url.
# More infos here: [https://repo.saltstack.com/]
# Example: 2019.2.0 (To pin the repo url to a specific version)
# Default: latest
#
# @param package_release_version
# Any valid release version.
# Only relevant if you set salt_release to major or minor!
# Example: 3002 (To pin the repo url to a major version)
# Example: 3002.1 (To pin the repo url to a minor version)
# Default: undef
#
# @param additional_packages
# Any additional packages you want to install.
# More infos, what you can set here: [https://forge.puppet.com/puppetlabs/stdlib/5.2.0/readme#ensure_packages]
Expand Down Expand Up @@ -68,6 +74,7 @@
String[1] $package_name,
String $package_ensure,
String $package_release,
Optional[String] $package_release_version,
Optional[Variant[Array, Hash]] $additional_packages,
Boolean $service_enable,
Enum['stopped', 'running'] $service_ensure,
Expand All @@ -78,7 +85,7 @@
){

if $repo_manage {
ensure_resource('salt::repo', $package_release)
ensure_resource('salt::repo', $package_release, {'salt_release_version' => $package_release_version })
}

contain salt::master::install
Expand Down
13 changes: 10 additions & 3 deletions manifests/minion.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@
# Default: lookup('salt::master::package_ensure')
#
# @param package_release
# latest or any valid release. This variable is used for the repo url.
# latest, major or minor. This variable is used for the repo url.
# More infos here: [https://repo.saltstack.com/]
# Example: 2019.2.0 (To pin the repo url to a specific version)
# Default: lookup('salt::master::package_release')
#
# @param package_release_version
# Any valid release version.
# Only relevant if you set salt_release to major or minor!
# Example: 3002 (To pin the repo url to a major version)
# Example: 3002.1 (To pin the repo url to a minor version)
# Default: lookup('salt::master::package_release_version')
#
# @param additional_packages
# Any additional packages you want to install.
# More infos, what you can set here: [https://forge.puppet.com/puppetlabs/stdlib/5.2.0/readme#ensure_packages]
Expand Down Expand Up @@ -64,6 +70,7 @@
String[1] $package_name,
String $package_ensure,
String $package_release,
Optional[String] $package_release_version,
Optional[Variant[Array, Hash]] $additional_packages,
Boolean $service_enable,
Enum['stopped', 'running'] $service_ensure,
Expand All @@ -74,7 +81,7 @@
){

if $repo_manage {
ensure_resource('salt::repo', $package_release)
ensure_resource('salt::repo', $package_release, {'salt_release_version' => $package_release_version })
}

contain salt::minion::install
Expand Down
16 changes: 13 additions & 3 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
# Adds the nessesary package repo to download the SaltStack packages.
#
# @param salt_release
# latest or any valid release. This variable is used for the repo url.
# latest, major or minor. This variable is used for the repo url.
# More infos here: [https://repo.saltstack.com/]
# Example: 2019.2.0 (To pin the repo url to a specific version)
#
# @param salt_release_version
# Any valid release version.
# Only relevant if you set salt_release to major or minor!
# Example: 3002 (To pin the repo url to a major version)
# Example: 3002.1 (To pin the repo url to a minor version)
#
# @param release
# Optional release to use in the apt source string.
Expand All @@ -15,6 +20,7 @@
define salt::repo (
String $salt_release = $title,
String $release = $facts['os']['distro']['codename'],
Optional[String] $salt_release_version = undef,
Optional[String] $repo_url = undef,
) {

Expand All @@ -27,8 +33,12 @@
} else {
if $salt_release == 'latest' {
$_url = "http://repo.saltstack.com/py3/${facts['os']['name'].downcase}/${facts['os']['distro']['release']['major']}/${facts['os']['architecture']}/latest"
} elsif $salt_release == 'major' {
$_url = "http://repo.saltstack.com/py3/${facts['os']['name'].downcase}/${facts['os']['distro']['release']['major']}/${facts['os']['architecture']}/${salt_release_version}"
} elsif $salt_release == 'minor' {
$_url = "http://repo.saltstack.com/py3/${facts['os']['name'].downcase}/${facts['os']['distro']['release']['major']}/${facts['os']['architecture']}/archive/${salt_release_version}"
} else {
$_url = "http://repo.saltstack.com/py3/${facts['os']['name'].downcase}/${facts['os']['distro']['release']['major']}/${facts['os']['architecture']}/archive/${salt_release}"
fail("\"${module_name}\" salt_release not vaild")
}
}

Expand Down
13 changes: 10 additions & 3 deletions manifests/syndic.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@
# Default: lookup('salt::master::package_ensure')
#
# @param package_release
# latest or any valid release. This variable is used for the repo url.
# latest, major or minor. This variable is used for the repo url.
# More infos here: [https://repo.saltstack.com/]
# Example: 2019.2.0 (To pin the repo url to a specific version)
# Default: lookup('salt::master::package_release')
#
# @param package_release_version
# Any valid release version.
# Only relevant if you set salt_release to major or minor!
# Example: 3002 (To pin the repo url to a major version)
# Example: 3002.1 (To pin the repo url to a minor version)
# Default: lookup('salt::master::package_release_version')
#
# @param additional_packages
# Any additional packages you want to install.
# More infos, what you can set here: [https://forge.puppet.com/puppetlabs/stdlib/5.2.0/readme#ensure_packages]
Expand Down Expand Up @@ -64,6 +70,7 @@
String[1] $package_name,
String $package_ensure,
String $package_release,
Optional[String] $package_release_version,
Optional[Variant[Array, Hash]] $additional_packages,
Boolean $service_enable,
Enum['stopped', 'running'] $service_ensure,
Expand All @@ -78,7 +85,7 @@
}

if $repo_manage {
ensure_resource('salt::repo', $package_release)
ensure_resource('salt::repo', $package_release, {'salt_release_version' => $package_release_version })
}

contain salt::syndic::install
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "joelkle-salt",
"version": "2.0.0",
"version": "2.1.0",
"author": "JoelKle",
"summary": "Installs, configures, and manages the SaltStack ( salt-minion / salt-master / salt-api / salt-syndic / salt-pepper ).",
"license": "Apache-2.0",
Expand Down

0 comments on commit e18b92a

Please sign in to comment.