Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Style/BlockDelimiters:
Style/BracesAroundHashParameters:
Description: Braces are required by Ruby 2.7. Cop removed from RuboCop v0.80.0.
See https://github.com/rubocop-hq/rubocop/pull/7643
Enabled: true
Enabled: false
Style/ClassAndModuleChildren:
Description: Compact style reduces the required amount of indentation.
EnforcedStyle: compact
Expand Down
2 changes: 2 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ Rakefile:
spec/default_facts.yml:
extra_facts:
operatingsystemrelease: 18.04
spec/spec_helper.rb:
mock_with: ':rspec'
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog
## Release 1.1.0
* Updated pdk version
* Added parameter for exec timeout(default is 300 seconds)
* Set correct owner for the `authproxy.cfg` file
* Fixed metadata license syntax
* Added Ubuntu 20.04 support
* Fixed pdk validation warnings
* Fixed deprecation warnings

## Release 1.0.0
* Added support for Ubuntu 18.04
* Replaced deprecated stankevich-python dependency a with puppet-python
* Updated pdk version
Expand Down
13 changes: 6 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,36 +53,35 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. 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)."
config.add_pr_wo_labels = true
config.issues = false
config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM"
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
config.configure_sections = {
"Changed" => {
"prefix" => "### Changed",
"labels" => ["backwards-incompatible"],
},
"Added" => {
"prefix" => "### Added",
"labels" => ["feature", "enhancement"],
"labels" => ["enhancement", "feature"],
},
"Fixed" => {
"prefix" => "### Fixed",
"labels" => ["bugfix"],
"labels" => ["bug", "documentation", "bugfix"],
},
}
end
else
desc 'Generate a Changelog from GitHub'
task :changelog do
raise <<EOM
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
The changelog tasks depends on recent features of the github_changelog_generator gem.
Please manually add it to your .sync.yml for now, and run `pdk update`:
---
Gemfile:
optional:
':development':
- gem: 'github_changelog_generator'
git: 'https://github.com/skywinder/github-changelog-generator'
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
version: '~> 1.15'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
EOM
end
end
Expand Down
2 changes: 1 addition & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
file { 'authproxy.cfg':
ensure => file,
path => "${duo_authproxy::install_dir}/conf/authproxy.cfg",
owner => 'nobody',
owner => 'duo_authproxy_svc',
group => 'root',
mode => '0400',
content => Sensitive(template("${module_name}/authproxy.cfg.erb")),
Expand Down
15 changes: 8 additions & 7 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
Hash $settings = {},
$proxy_server = undef,
$proxy_type = undef,
$exec_timeout = 300,
) {

if $::operatingsystemrelease == '18.04' {
if ($::operatingsystemrelease == '18.04') or ($::operatingsystemrelease == '20.04') {
$python_version = 'python3_version'
}else {
$python_version = 'python_version'
Expand All @@ -29,12 +30,12 @@
contain 'duo_authproxy::config'
contain 'duo_authproxy::service'

Class['::duo_authproxy::install']
-> Class['::duo_authproxy::config']
Class['duo_authproxy::install']
-> Class['duo_authproxy::config']

Class['::duo_authproxy::install']
~> Class['::duo_authproxy::service']
Class['duo_authproxy::install']
~> Class['duo_authproxy::service']

Class['::duo_authproxy::config']
~> Class['::duo_authproxy::service']
Class['duo_authproxy::config']
~> Class['duo_authproxy::service']
}
4 changes: 4 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
command => "mv duoauthproxy-${duo_authproxy::version}*-src duoauthproxy-${duo_authproxy::version}-src",
cwd => '/tmp',
path => '/bin',
timeout => $duo_authproxy::exec_timeout,
creates => $creates_path,
}

Expand All @@ -35,6 +36,7 @@
cwd => "/tmp/duoauthproxy-${duo_authproxy::version}-src",
environment => ['PYTHON=python'],
path => $facts['path'],
timeout => $duo_authproxy::exec_timeout,
creates => $creates_path,
require => Package[$duo_authproxy::dep_packages],
}
Expand All @@ -44,12 +46,14 @@
cwd => "/tmp/duoauthproxy-${duo_authproxy::version}-src",
environment => ['PYTHON=python'],
path => $facts['path'],
timeout => $duo_authproxy::exec_timeout,
creates => $creates_path,
}

-> exec { 'duoauthproxy-tag':
command => "touch ${creates_path}",
path => $facts['path'],
timeout => $duo_authproxy::exec_timeout,
creates => $creates_path,
}
}
15 changes: 8 additions & 7 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "MiamiOH-duo_authproxy",
"version": "1.0.0",
"version": "1.1.0",
"author": "Chris Edester",
"summary": "Installs and configures Duo Authentication Proxy",
"license": "GPL-3.0+",
"license": "GPL-3.0",
"source": "https://github.com/MiamiOH/puppet-duo_authproxy.git",
"project_page": "https://github.com/MiamiOH/puppet-duo_authproxy",
"issues_url": "https://github.com/MiamiOH/puppet-duo_authproxy/issues",
Expand Down Expand Up @@ -56,22 +56,23 @@
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"16.04",
"18.04"
"18.04",
"20.04"
]
}
],
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.7.0 < 6.0.0"
"version_requirement": ">= 4.7.0 < 8.0.0"
}
],
"tags": [
"duo",
"authentication",
"ldap"
],
"pdk-version": "1.18.0",
"template-url": "pdk-default#1.18.0",
"template-ref": "tags/1.18.0-0-g095317c"
"pdk-version": "2.1.0",
"template-url": "https://github.com/puppetlabs/pdk-templates#master",
"template-ref": "remotes/origin/master-0-ga58fd92"
}
5 changes: 4 additions & 1 deletion spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
is_expected.to contain_file('authproxy.cfg').with(
'ensure' => 'file',
'path' => '/opt/duoauthproxy/conf/authproxy.cfg',
'content' => "# Managed by Puppet.\n\n[main]\ndebug=true\n\n",
'owner' => 'duo_authproxy_svc',
'group' => 'root',
'mode' => '0400',
'content' => 'Sensitive [value redacted]',
)
end
end
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# frozen_string_literal: true

RSpec.configure do |c|
c.mock_with :rspec
end

require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'

Expand Down