Skip to content

Commit

Permalink
maintainability: fixed CI, bumped dependencies to support latest vers…
Browse files Browse the repository at this point in the history
…ions of OSes & Puppet

- Added support for latest versions of Debian & Ubuntu
- Support Puppet >= 7
- Replaced Travis which has now shutdown with GH actions
- Fixed missing dependency over puppetlabs/yumrepo_core` module
  • Loading branch information
mvisonneau committed Mar 1, 2022
1 parent 27b5fb0 commit 0bdc737
Show file tree
Hide file tree
Showing 21 changed files with 170 additions and 153 deletions.
14 changes: 5 additions & 9 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
fixtures:
repositories:
apt: "git://github.com/puppetlabs/puppetlabs-apt.git"
cron_core:
repo: "https://github.com/puppetlabs/puppetlabs-cron_core"
puppet_version: '>= 6.0.0'
stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib.git"
yumrepo_core:
repo: "git://github.com/puppetlabs/puppetlabs-yumrepo_core.git"
puppet_version: '>= 6.0.0'
forge_modules:
apt: puppetlabs/apt
cron: puppet/cron
stdlib: puppetlabs/stdlib
yumrepo_core: puppetlabs/yumrepo_core
symlinks:
curator: "#{source_dir}"
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release new version of the module to the Puppet Forge

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Build and publish module
uses: barnumbirr/[email protected]
env:
FORGE_API_KEY: ${{ secrets.FORGE_API_KEY }}
REPOSITORY_URL: https://forgeapi.puppet.com/v3/releases
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test

on: [push, pull_request]

jobs:
test:
strategy:
fail-fast: false
matrix:
check: [syntax, lint, check, spec, metadata_lint, build]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5

- run: bundle -v; gem update --system; gem update bundler; gem --version; bundle -v; bundle install
- run: bundle exec rake ${{ matrix.check }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Gemfile.lock
spec/fixtures
pkg
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,69 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### ENHANCEMENTS

## [v1.0.8] - 2022-03-01
### CHANGED

- Added support for latest versions of Debian & Ubuntu
- Support Puppet >= 7
- Gracefully handle unsupported OSes [GH-18]
- Replaced Travis which has now shutdown with GH actions
- Fixed missing dependency over puppetlabs/yumrepo_core` module

## [v1.0.7] - 2019-03-12
### FEATURES

- Added support for Debian Stretch [GH-17]

### BUGFIXES

- Fixed Travis CI pipeline [GH-17]

## [v1.0.6] - 2018-08-13
### ENHANCEMENTS

- Added the possibility to configure the path of the curator command [GH-5]
- Lint improvements
- Additional testing use cases [GH-11]

### BUGFIXES

- Updated parameter types on jobs in order to support more configs [GH-8]
- Fixed support for alias and added support for cluster_routing, index_settings, reindex, rollover and shrink actions [GH-7]

## [v1.0.5] - 2018-07-13
### ENHANCEMENTS

- Support of unquoted booleans within curator config [GH-6]

## [v1.0.4] - 2018-01-30
### ENHANCEMENTS

- Added CHANGELOG.md
- Reverted String to Integer as Hash keys for the config

### BUGFIXES

- Fixed broken Debian CI rspec tests

## [v1.0.3] - 2017-09-15
### BUGFIXES

- Update action.pp [GH-1]

## [v1.0.2] - 2017-01-24
### ENHANCEMENTS

- Updated actions and jobs definitions

## [v1.0.1] - 2017-01-20
### FEATURES

- Init

[Unreleased]: https://github.com/mvisonneau/puppet-curator/compare/v1.0.7...HEAD
[Unreleased]: https://github.com/mvisonneau/puppet-curator/compare/v1.0.8...HEAD
[v1.0.8]: https://github.com/mvisonneau/puppet-curator/compare/v1.0.7...v1.0.8
[v1.0.7]: https://github.com/mvisonneau/puppet-curator/compare/v1.0.6...v1.0.7
[v1.0.6]: https://github.com/mvisonneau/puppet-curator/compare/v1.0.5...v1.0.6
[v1.0.5]: https://github.com/mvisonneau/puppet-curator/compare/v1.0.4...v1.0.5
Expand Down
10 changes: 4 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ source 'https://rubygems.org'

gem 'facter'
gem 'hiera'
gem 'puppet-blacksmith'
gem 'metadata-json-lint'
gem 'parallel_tests', :require => false
gem 'pdk'
gem 'puppet', '~> 7.0'
gem 'puppet-blacksmith'
gem 'puppet-lint'
gem 'puppetlabs_spec_helper'
gem 'rake'
gem 'rspec'
gem 'rspec-core'
gem 'rspec-puppet'
gem 'rspec-puppet-facts'
gem 'metadata-json-lint'
gem 'parallel_tests', :require => false

puppetversion = ENV['PUPPET_VERSION'] || '~> 6.0'
gem 'puppet', puppetversion
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# puppet-curator

[![Puppet Forge](http://img.shields.io/puppetforge/v/mvisonneau/curator.svg)](https://forge.puppetlabs.com/mvisonneau/curator)
[![Build Status](https://travis-ci.org/mvisonneau/puppet-curator.svg?branch=master)](https://travis-ci.org/mvisonneau/puppet-curator)
[![Puppet Forge downloads](https://img.shields.io/puppetforge/dt/mvisonneau/curator.svg)](https://forge.puppetlabs.com/mvisonneau/curator)
[![Puppet Forge score](https://img.shields.io/puppetforge/f/mvisonneau/curator.svg)](https://forge.puppetlabs.com/mvisonneau/curator)

[![test](https://github.com/mvisonneau/puppet-curator/actions/workflows/test.yml/badge.svg)](https://github.com/mvisonneau/puppet-curator/actions/workflows/test.yml)

This module installs, configures, and manages [curator](https://www.elastic.co/guide/en/elasticsearch/client/curator/index.html), an [elastic](https://www.elastic.co/) product that allows management of an elasticsearch cluster indices.

It has been inspired of the [jlambert121-curator](https://github.com/jlambert121/jlambert121-curator) module but completely redesigned in order to support curator `> 4.x`
It has been inspired of the [jlambert121-curator](https://github.com/jlambert121/jlambert121-curator) module but designed to support curator `> 4.x`

## Usage

Expand Down Expand Up @@ -116,13 +115,13 @@ curator::jobs::values:

## Limitations

This module has been built on and tested against Puppet 4.3 and higher.
This module has been built on and tested from Puppet `4.3` up to `7.14`.

The module has been tested on:

- Debian 7/8/9
- CentOS 6/7
- Ubuntu 14.04, 16.04, 18.04
- Debian 7 -> 11
- RHEL/CentOS 6/7
- Ubuntu 14 -> 20

Testing on other platforms has been light and cannot be guaranteed.

Expand Down
11 changes: 3 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,15 @@ task :spec_prep do

site='./spec/fixtures/manifests/site.pp'
File.delete(site) if File.exist?(site)
symlink('../../../tests/site.pp', site , options )
symlink('../../../examples/site.pp', site , options )

File.delete('./spec/fixtures/hiera.yaml') if File.symlink?('./spec/fixtures/hiera.yaml')
symlink('../../tests/hiera.yaml', './spec/fixtures/hiera.yaml', options )
symlink('../../examples/hiera.yaml', './spec/fixtures/hiera.yaml', options )

File.delete('./spec/fixtures/hieradata') if File.symlink?('./spec/fixtures/hieradata')
symlink('../../tests/hieradata/', './spec/fixtures/hieradata', options )

symlink('../../examples/hieradata/', './spec/fixtures/hieradata', options )
end





#########################################################################
# Define rake runs collection of tasks
#########################################################################
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 16 additions & 15 deletions manifests/job.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,26 @@
#
define curator::job (
String $action,
Variant[Integer[0,23],Array[Integer[0,23]],Enum['*']] $hour,
Variant[Integer[0,59],Array[Integer[0,59]],Enum['*']] $minute,
String $ensure = 'present',
Variant[Integer[0,11],Array[Integer[0,11]],Enum['*']] $month = '*',
Variant[Integer[0,30],Array[Integer[0,30]],Enum['*']] $monthday = '*',
String $user = $::curator::user_name,
Variant[Integer[0,6],Array[Integer[0,6]],Enum['*']] $weekday = '*',
Variant[Integer[0,23],Array[Integer[0,23]],Enum['*']] $hour,
Variant[Integer[0,30],Array[Integer[0,30]],Enum['*']] $date = '*',
Variant[Integer[0,11],Array[Integer[0,11]],Enum['*']] $month = '*',
String $user = $::curator::user_name,
Variant[Integer[0,6],Array[Integer[0,6]],Enum['*']] $weekday = '*',
String $ensure = 'present',
) {
require curator
require curator::config
require cron

cron { "curator_${name}":
ensure => $ensure,
command => "${::curator::command} ${::curator::config_path}/action_${action}.yml> /dev/null 2>&1",
hour => $hour,
minute => $minute,
month => $month,
monthday => $monthday,
user => $user,
weekday => $weekday,
cron::job { "curator_${name}":
ensure => $ensure,
minute => $minute,
hour => $hour,
date => $date,
month => $month,
weekday => $weekday,
user => $user,
command => "${::curator::command} ${::curator::config_path}/action_${action}.yml> /dev/null 2>&1",
}
}
61 changes: 28 additions & 33 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,34 @@
# This class is meant to be called from curator
# It sets variables according to platform
class curator::params{
$action_mode = '0644'
$certificate = undef
$client_cert = undef
$client_key = undef
$command = '$(which curator)'
$config_file = '/etc/curator/curator.yml'
$config_file_mode = '0660'
$config_path = '/etc/curator'
$config_path_mode = '0755'
$ensure = 'present'
$hosts = [ '127.0.0.1' ]
$http_auth = undef
$log_blacklist = [ 'elasticsearch', 'urllib3' ]
$log_file = undef
$log_format = 'default'
$log_level = 'INFO'
$manage_repository = true
$manage_user = true
$master_only = false
$port = 9200
$repository_version = '5'
$ssl_no_validate = false
$timeout = 30
$url_prefix = undef
$user_group = 'users'
$user_home = '/home/curator'
$user_name = 'curator'
$use_ssl = false


$action_mode = '0644'
$certificate = undef
$client_cert = undef
$client_key = undef
$command = '$(which curator)'
$config_file = '/etc/curator/curator.yml'
$config_file_mode = '0660'
$config_path = '/etc/curator'
$config_path_mode = '0755'
$ensure = 'present'
$hosts = [ '127.0.0.1' ]
$http_auth = undef
$log_blacklist = [ 'elasticsearch', 'urllib3' ]
$log_file = undef
$log_format = 'default'
$log_level = 'INFO'
$manage_repository = true
$manage_user = true
$master_only = false
$port = 9200
$repository_version = '5'
$ssl_no_validate = false
$timeout = 30
$url_prefix = undef
$user_group = 'users'
$user_home = '/home/curator'
$user_name = 'curator'
$use_ssl = false

case $::os['family'] {
'Debian': {
Expand All @@ -48,7 +46,4 @@
$package_provider = 'pip'
}
}



}
1 change: 1 addition & 0 deletions manifests/repository/apt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'14.04' => '',
'16.04' => '',
'18.04' => '',
'20.04' => '',

default => fail('Unsupported major operating system version'),
}
Expand Down
Loading

0 comments on commit 0bdc737

Please sign in to comment.