summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--promises.cf9
-rw-r--r--services/main.cf10
-rw-r--r--services/ubuntu.cf53
3 files changed, 61 insertions, 11 deletions
diff --git a/promises.cf b/promises.cf
index 89d0369..4295ec9 100644
--- a/promises.cf
+++ b/promises.cf
@@ -5,12 +5,13 @@ body common control
cfengine_controls,
cfengine_stdlib,
classify,
- hello,
+ @(classify.bundles),
};
inputs => {
- @(cfengine_controls.inputs),
- @(cfengine_stdlib.inputs),
- "services/main.cf",
+ @(cfengine_controls.inputs),
+ @(cfengine_stdlib.inputs),
+ "services/main.cf",
+ @(classify.inputs),
};
}
diff --git a/services/main.cf b/services/main.cf
index 5808f31..440d6d2 100644
--- a/services/main.cf
+++ b/services/main.cf
@@ -7,6 +7,9 @@
bundle common classify
{
+ vars:
+ "bundles" slist => { "ubuntu" };
+ "inputs" slist => { "services/ubuntu.cf" };
classes:
any::
"containers" or => {
@@ -15,10 +18,3 @@ bundle common classify
};
"mail_servers" or => { "legend" };
}
-
-bundle agent hello
-{
- reports:
- any::
- "$(this.bundle): hello world";
-}
diff --git a/services/ubuntu.cf b/services/ubuntu.cf
new file mode 100644
index 0000000..13cd3df
--- /dev/null
+++ b/services/ubuntu.cf
@@ -0,0 +1,53 @@
+bundle agent ubuntu
+{
+ vars:
+ ubuntu::
+ "wanted" slist => {
+ "dstat",
+ "git",
+ "htop",
+ "lsb",
+ "mailutils",
+ "ncdu",
+ "socat",
+ "tig",
+ "tmux",
+ "tree",
+ "vim",
+ };
+ ubuntu&!containers::
+ "wanted" slist => {
+ @(wanted),
+ "apt-file",
+ "asciidoc",
+ "build-essential",
+ "cgdb",
+ "cmake",
+ "ethtool",
+ "gpa",
+ "iptstate",
+ "ipvsadm",
+ "lvm2",
+ "mosh",
+ "nmap",
+ "ntpdate",
+ "openntpd",
+ "openssh-server",
+ "needrestart",
+ "pass",
+ "pwgen",
+ "sipcalc",
+ "valgrind",
+ "weechat",
+ "whois",
+ };
+ packages:
+ ubuntu::
+ "$(wanted)"
+ policy => "present",
+ package_module => apt_get,
+ classes => if_repaired("ubuntu_$(wanted)_add_repaired");
+ reports:
+ any::
+ "$(this.bundle): $(wanted) installed" ifvarclass => "ubuntu_$(wanted)_add_repaired";
+}