William Myers
10/25/2022, 10:29 PM---
version: 5
defaults: # Used for any hierarchy level that omits these keys.
datadir: data # This path is relative to hiera.yaml's directory.
data_hash: yaml_data # Use the built-in YAML backend.
hierarchy:
- name: "osfamily/major release"
paths:
# Used to distinguish between Debian and Ubuntu
- "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
- "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
# Used for Solaris
- "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
- name: "osfamily"
paths:
- "os/%{facts.os.name}.yaml"
- "os/%{facts.os.family}.yaml"
- name: 'common'
path: 'common.yaml'
- name: "secret data"
lookup_key: eyaml_lookup_key # eyaml backend
path: "secrets.eyaml"
options:
pkcs7_private_key: /etc/puppetlabs/puppet/keys/private_key.pkcs7.pem
pkcs7_public_key: /etc/puppetlabs/puppet/keys/public_key.pkcs7.pemSlackbot
10/25/2022, 10:29 PMWilliam Myers
10/25/2022, 10:30 PM---
version: 5
defaults: # Used for any hierarchy level that omits these keys.
datadir: data # This path is relative to hiera.yaml's directory.
data_hash: yaml_data # Use the built-in YAML backend.
hierarchy:
- name: "osfamily/major release"
paths:
# Used to distinguish between Debian and Ubuntu
- "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
- "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
# Used for Solaris
- "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
- name: "osfamily"
paths:
- "os/%{facts.os.name}.yaml"
- "os/%{facts.os.family}.yaml"
- name: 'common'
path: 'common.yaml'
- name: "secret data"
lookup_key: eyaml_lookup_key # eyaml backend
path: "secrets.eyaml"
options:
pkcs7_private_key: /etc/puppetlabs/puppet/keys/private_key.pkcs7.pem
pkcs7_public_key: /etc/puppetlabs/puppet/keys/public_key.pkcs7.pemnatemccurdy
10/25/2022, 10:31 PMWilliam Myers
10/25/2022, 10:32 PMWilliam Myers
10/25/2022, 10:33 PMoptions:
pkcs7_private_key: /etc/puppetlabs/puppet/keys/private_key.pkcs7.pem
pkcs7_public_key: /etc/puppetlabs/puppet/keys/public_key.pkcs7.pemnatemccurdy
10/25/2022, 10:34 PMWilliam Myers
10/25/2022, 10:34 PMnatemccurdy
10/25/2022, 10:35 PMnatemccurdy
10/25/2022, 10:35 PMnatemccurdy
10/25/2022, 10:35 PMWilliam Myers
10/25/2022, 10:36 PMWilliam Myers
10/25/2022, 10:39 PM---
version: 5
defaults:
datadir: "hieradata"
hierarchy:
- name: "Yaml backend"
data_hash: yaml_data
paths:
- "nodes/%{trusted.certname}.yaml"
- "common.yaml"
- name: "EYaml Backend"
lookup_key: eyaml_lookup_key # eyaml backend
paths:
- 'secrets.eyaml'
options:
pkcs7_private_key: /etc/puppetlabs/puppet/keys/private_key.pkcs7.pem
pkcs7_public_key: /etc/puppetlabs/puppet/keys/public_key.pkcs7.pem
module
---
version: 5
defaults: # Used for any hierarchy level that omits these keys.
datadir: data # This path is relative to hiera.yaml's directory.
data_hash: yaml_data # Use the built-in YAML backend.
hierarchy:
- name: "osfamily/major release"
paths:
# Used to distinguish between Debian and Ubuntu
- "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
- "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
# Used for Solaris
- "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
- name: "osfamily"
paths:
- "os/%{facts.os.name}.yaml"
- "os/%{facts.os.family}.yaml"
- name: 'common'
path: 'common.yaml'
- name: 'common-enc'
path: 'common.eyaml'Dr Bunsen Honeydew
10/25/2022, 10:39 PMWilliam Myers
10/25/2022, 10:40 PMWilliam Myers
10/25/2022, 10:40 PMWilliam Myers
10/25/2022, 10:41 PMWilliam Myers
10/25/2022, 10:45 PMnatemccurdy
10/25/2022, 10:50 PM*.yaml.
That allows me to mix plaintext data with encrypted data in the same file.natemccurdy
10/25/2022, 10:51 PMeyaml backend is able to return plaintext keys that aren’t encrypted. So it’s essentially the same as the yaml backend.William Myers
10/25/2022, 10:51 PMkenyon
10/25/2022, 10:53 PMkenyon
10/25/2022, 10:53 PMkenyon
10/25/2022, 10:53 PMnatemccurdy
10/25/2022, 11:00 PMWilliam Myers
10/25/2022, 11:27 PMWilliam Myers
10/25/2022, 11:28 PMWilliam Myers
10/25/2022, 11:31 PM# @summary A short summary of the purpose of this class
#
# deploys the service account svcansiblelocal to linux hosts
# Requires the puppetlabs accounts and saz-sudo modules
#
# @example
# include account_svcansiblelocal
class account_svcansiblelocal (
String $user_password
) {
$user_name = 'svcansiblelocal'
$user_groups = ['users']
$user_comment = 'Service Account - Ansible'
$user_locked = false
$user_purge_sshkeys = true
$user_sshkeys = [
'from="192.168.4.61" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCb08mJu9k0fBNL4y5MaxC2n8mo1JGdIKS0KcXn27rBblMo2JP9c7KbDwhUotxdCAHOZQzN21rQVMQJjGfzY2Qym2qWre54mOo1dIGHQk2GL2sy/ooTCdNRU/eFpdeF+VEDGORzh+X6280YdxubpWEvs81YmyxYZzZd0dKPlAg1bEbj4z5UHHzkQ4/EWe1vcBoFlJ8zSPvT31Jz7uRu/VOjs3qF4lmxbnLGzcrWoyI4yky3mxfoaL0/KqEVfWI1YL5MHmVBsmEa/leygsg/jhVPQNRSerATmEa3oXCY6EBsDuN60YdaS0Vo/E+qzT+5K8LpMMi/A6197SdUaPU0V+BP svcansiblelocal v1.00'
]
$user_sudo_ensure = present
$user_sudo_content = 'svcansiblelocal ALL=(ALL) NOPASSWD:ALL'
accounts::user { "$user_name":
comment => $user_comment,
groups => $user_groups,
password => '124password',
locked => $user_locked,
sshkeys => $user_sshkeys,
purge_sshkeys => $user_purge_sshkeys,
}
class privileges {
sudo::conf { "$user_name":
ensure => $user_sudo_ensure,
content => $user_sudo_content,
}
}
}Dr Bunsen Honeydew
10/25/2022, 11:31 PMsaz-sudo module at https://forge.puppet.com/saz/sudo?src=slack&channel=puppet