--- /dev/null
+---
+classes:
+ role::caldance: ~
+letsencrypt::hosts: "%{lookup('base_installation::system_hostname')}"
filter = "(objectclass=*)"
data = {}
- connection.search(base, scope, filter) do |entry|
- data_ = entry.to_hash
- jsons = data_["immaePuppetJson"] || []
+ data_array = connection.search2(base, scope, filter, attrs=["immaePuppetJson", "dn"]).map do |entry|
+ [entry["dn"].first, entry["immaePuppetJson"] || []]
+ end.sort_by do |dn, json|
+ if dn == "ou=roles,ou=hosts,dc=immae,dc=eu"
+ [0, dn]
+ elsif dn.end_with?("ou=roles,ou=hosts,dc=immae,dc=eu")
+ [1, dn]
+ else
+ [2, dn]
+ end
+ end.to_h
+
+ data_array.each do |dn, jsons|
jsons.each do |json|
data.merge!(JSON.parse(json))
end
$users.each |$user| {
if ($user["username"] != "root") {
+ unless $user["shell"] == undef or empty($user["shell"]) {
+ ensure_packages([$user["shell"]])
+ $shell = "/bin/${user[shell]}"
+ } else {
+ $shell = undef
+ }
+
user { "${user[username]}:${user[userid]}":
name => $user[username],
uid => $user[userid],
managehome => true,
system => !!$user[system],
home => "/home/${user[username]}",
+ shell => $shell,
notify => Exec["remove_password:${user[username]}:${user[userid]}"],
purge_ssh_keys => true
}
--- /dev/null
+class role::caldance (
+) {
+ include "base_installation"
+
+ include "profile::tools"
+ include "profile::postgresql"
+ include "profile::apache"
+ include "profile::redis"
+
+ ensure_packages(["python-pip", "python-virtualenv", "python-django"])
+}