Download:
child 2:048edc316ce1
parent 0:52035246db0a
1:7ab80565bcdd
Anton Shestakov <av6@dwimlabs.net>, Sat, 19 Mar 2016 00:37:23 +0800
provision: add common role as a base

5 файлов изменено, 41 вставок(+), 0 удалений(-) [+]
contrib/provision/roles/common/defaults/main.yml file | annotate | diff | comparison | revisions
contrib/provision/roles/common/files/etc/apt/apt.conf.d/99recommends file | annotate | diff | comparison | revisions
contrib/provision/roles/common/handlers/main.yml file | annotate | diff | comparison | revisions
contrib/provision/roles/common/tasks/main.yml file | annotate | diff | comparison | revisions
contrib/provision/roles/common/templates/etc/timezone file | annotate | diff | comparison | revisions
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/provision/roles/common/defaults/main.yml Sat Mar 19 00:37:23 2016 +0800
@@ -0,0 +1,4 @@
+---
+locale: en_US.UTF-8
+timezone: Etc/UTC
+...
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/provision/roles/common/files/etc/apt/apt.conf.d/99recommends Sat Mar 19 00:37:23 2016 +0800
@@ -0,0 +1,1 @@
+APT::Install-Recommends "no";
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/provision/roles/common/handlers/main.yml Sat Mar 19 00:37:23 2016 +0800
@@ -0,0 +1,4 @@
+---
+- name: update timezone
+ command: dpkg-reconfigure --frontend noninteractive tzdata
+...
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/provision/roles/common/tasks/main.yml Sat Mar 19 00:37:23 2016 +0800
@@ -0,0 +1,31 @@
+---
+- name: Set timezone {{ timezone }}
+ template: src=etc/timezone dest=/etc/timezone
+ notify:
+ - update timezone
+
+- name: Generate locale
+ locale_gen: name={{ locale }}
+
+- name: Set system locale
+ command: update-locale LANG={{ locale }}
+
+- name: Install base packages
+ apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=3600
+ with_items:
+ - ca-certificates
+ - openntpd
+ - ufw
+ tags: [packages]
+
+- name: Stop installing recommends
+ copy: src=etc/apt/apt.conf.d/99recommends dest=/etc/apt/apt.conf.d/99recommends
+
+- name: Allow ssh access
+ ufw: rule=allow name=OpenSSH
+ tags: [ufw]
+
+- name: Enable ufw
+ ufw: state=enabled
+ tags: [ufw]
+...
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/provision/roles/common/templates/etc/timezone Sat Mar 19 00:37:23 2016 +0800
@@ -0,0 +1,1 @@
+{{ timezone }}