From dbc1be6b24b5819c5237f83cc00d81bc95398edc Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 5 Mar 2017 19:20:21 +0000 Subject: Added basic ubuntu promises --- promises.cf | 9 +++++---- services/main.cf | 10 +++------- services/ubuntu.cf | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 services/ubuntu.cf 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"; +} -- cgit v1.2.3