Skip to content

Commit

Permalink
Merge pull request #408 from puppetlabs/pdksync_maint/pdk_update_20-04
Browse files Browse the repository at this point in the history
pdksync - (Maint) PDK Update
  • Loading branch information
LukasAud authored Apr 20, 2022
2 parents e667149 + ed0a32c commit 064cb64
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,5 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }}
# Optional Input
channel: '#team-ia-bots'
channel: '#team-cat-bots'
name: 'GABot'
8 changes: 4 additions & 4 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ jobs:
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
# - name: Run Static & Syntax Tests
# if: ${{ github.repository_owner == 'puppetlabs' }}
# run: |
# buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
- name: Run Static & Syntax Tests
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
- name: Setup Spec Test Matrix
id: get-matrix
Expand Down
2 changes: 1 addition & 1 deletion examples/group_common.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$users_hash = {
'jblow' => {
'comment' => 'Joe Blow',
'groups' => [ wheel ],
'groups' => [wheel],
'uid' => '1115',
'gid' => '1115',
'group' => 'mrblow',
Expand Down
2 changes: 1 addition & 1 deletion examples/user_group_hash.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'jeff' => {
'shell' => '/bin/zsh',
'comment' => 'Jeff McCune',
'groups' => [ admin, sudonopw, ],
'groups' => [admin, sudonopw,],
'uid' => '1112',
'gid' => '1112',
'locked' => true,
Expand Down
2 changes: 1 addition & 1 deletion manifests/home_dir.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#
# @api private
#
define accounts::home_dir(
define accounts::home_dir (
Enum['absent','present'] $ensure = 'present',
Optional[String] $bash_profile_content = undef,
Optional[Stdlib::Filesource] $bash_profile_source = undef,
Expand Down
3 changes: 1 addition & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
Accounts::Group::Hash $group_list = {},
Accounts::User::Resource $user_defaults = {},
Accounts::User::Hash $user_list = {},
)
{
) {
ensure_resources('group', $group_list, $group_defaults)
ensure_resources('accounts::user', $user_list, $user_defaults)
}
4 changes: 1 addition & 3 deletions manifests/key_management.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
# @api private
#
define accounts::key_management(
define accounts::key_management (
Accounts::User::Name $user,
Enum['absent','present'] $ensure = 'present',
Optional[Accounts::User::Name] $group = undef,
Expand All @@ -45,7 +45,6 @@
Array[String] $sshkeys = [],
Optional[Stdlib::Unixpath] $user_home = undef,
) {

if $user_home {
$sshkey_dotdir = "${user_home}/.ssh"
}
Expand Down Expand Up @@ -79,7 +78,6 @@
$sshkey_require = File[$sshkey_dotdir]
}
$sshkey_before = undef

} else {
if $purge_user_home and $user_home {
file { $sshkey_dotdir:
Expand Down
3 changes: 1 addition & 2 deletions manifests/manage_keys.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
#
# @api private
#
define accounts::manage_keys(
define accounts::manage_keys (
Stdlib::Unixpath $key_file,
String $keyspec,
Accounts::User::Name $user,
Enum['absent','present'] $ensure = 'present',
Accounts::User::Name $key_owner = $user,
) {

$key_def = accounts_ssh_authorized_keys_line_parser($keyspec)
if (! $key_def) {
err("Could not interpret SSH key definition: '${keyspec}'")
Expand Down
12 changes: 5 additions & 7 deletions manifests/user.pp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
Boolean $purge_sshkeys = false,
Boolean $purge_user_home = false,
Optional[String] $salt = undef,
Optional[Stdlib::Unixpath] $shell = '/bin/bash',
Stdlib::Unixpath $shell = '/bin/bash',
Optional[Stdlib::Unixpath] $sshkey_custom_path = undef,
Optional[Accounts::User::Name] $sshkey_group = $group,
Optional[Accounts::User::Name] $sshkey_owner = $name,
Expand All @@ -217,7 +217,6 @@
Boolean $system = false,
Optional[Accounts::User::Uid] $uid = undef,
) {

assert_type(Accounts::User::Name, $name)

include accounts::user::defaults
Expand Down Expand Up @@ -332,7 +331,7 @@
forward_source => $forward_source,
user => $name,
group => $group,
require => [ User[$name] ],
require => [User[$name]],
}
accounts::key_management { "${name}_key_management":
ensure => 'present',
Expand All @@ -345,7 +344,7 @@
sshkey_group => $sshkey_group,
sshkey_mode => $sshkey_mode,
purge_user_home => $purge_user_home,
require => Accounts::Home_dir[$_home]
require => Accounts::Home_dir[$_home],
}
} elsif $sshkeys != [] {
# We are not managing the user's home directory but we have specified a
Expand All @@ -361,9 +360,8 @@
sshkey_mode => $sshkey_mode,
sshkey_custom_path => $sshkey_custom_path,
}
}
else {
warning("ssh keys were passed for user ${name} but $managehome is set to false; not managing user ssh keys")
} else {
warning("ssh keys were passed for user ${name} but managehome is set to false; not managing user ssh keys")
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions manifests/user/defaults.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
Stdlib::AbsolutePath $home_template = '/home/%s',
Stdlib::AbsolutePath $locked_shell = '/sbin/nologin',
Stdlib::AbsolutePath $root_home = '/root',
)
{
) {
# Nothing to see here; move along.
}

2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@
}
],
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
"template-ref": "heads/main-0-gf3911d3",
"template-ref": "heads/main-0-g806810b",
"pdk-version": "2.3.0"
}

0 comments on commit 064cb64

Please sign in to comment.