Browse Source

move to non-deprecated template variable formatting

Alex Payne 10 years ago
parent
commit
d28f0f82b9

+ 3
- 3
roles/blog/tasks/blog.yml View File

1
 - name: Create directory for blog HTML
1
 - name: Create directory for blog HTML
2
-  file: state=directory path=/var/www/${domain} group=www-data owner=www-data
2
+  file: state=directory path=/var/www/{{ domain }} group=www-data owner=www-data
3
 
3
 
4
 - name: Configure the Apache HTTP server for the blog
4
 - name: Configure the Apache HTTP server for the blog
5
-  template: src=etc_apache2_sites-available_blog.j2 dest=/etc/apache2/sites-available/${domain} group=www-data owner=www-data
5
+  template: src=etc_apache2_sites-available_blog.j2 dest=/etc/apache2/sites-available/{{ domain }} group=www-data owner=www-data
6
   notify: restart apache
6
   notify: restart apache
7
 
7
 
8
 - name: Enable blog site
8
 - name: Enable blog site
9
-  command: a2ensite ${domain} creates=/etc/apache2/sites-enabled/${domain}
9
+  command: a2ensite {{ domain }} creates=/etc/apache2/sites-enabled/{{ domain }}
10
   notify: restart apache
10
   notify: restart apache
11
 
11
 

+ 2
- 2
roles/common/tasks/encfs.yml View File

23
 
23
 
24
 # If it is empty, we need to create the encfs
24
 # If it is empty, we need to create the encfs
25
 - name: Create encfs
25
 - name: Create encfs
26
-  shell: printf "p\n${encfs_password}" | encfs /encrypted /decrypted --public --stdinpass && touch /decrypted/test
26
+  shell: printf "p\n{{ encfs_password }}" | encfs /encrypted /decrypted --public --stdinpass && touch /decrypted/test
27
   when: encfs_check.rc > 0
27
   when: encfs_check.rc > 0
28
 
28
 
29
 # If it isn't empty, we simply need to mount it (but only if /decrypted/test doesn't exist)
29
 # If it isn't empty, we simply need to mount it (but only if /decrypted/test doesn't exist)
30
 - name: Mount encfs
30
 - name: Mount encfs
31
-  shell: printf "${encfs_password}" | encfs /encrypted /decrypted --public --stdinpass creates="/decrypted/test"
31
+  shell: printf "{{ encfs_password }}" | encfs /encrypted /decrypted --public --stdinpass creates="/decrypted/test"
32
   when: encfs_check.rc == 0
32
   when: encfs_check.rc == 0
33
 
33
 
34
 - name: Set decrypted directory permissions
34
 - name: Set decrypted directory permissions

+ 1
- 1
roles/common/tasks/users.yml View File

1
 - name: Create main user account
1
 - name: Create main user account
2
-  user: name=${main_user_name} state=present shell=/usr/bin/zsh groups=sudo,fuse
2
+  user: name={{ main_user_name }} state=present shell=/usr/bin/zsh groups=sudo,fuse

+ 3
- 3
roles/ircbouncer/tasks/znc.yml View File

17
     - libperl-dev
17
     - libperl-dev
18
 
18
 
19
 - name: Download znc release
19
 - name: Download znc release
20
-  get_url: url=http://znc.in/releases/archive/znc-${znc_version}.tar.gz dest=/root/znc-${znc_version}.tar.gz
20
+  get_url: url=http://znc.in/releases/archive/znc-{{ znc_version }}.tar.gz dest=/root/znc-{{ znc_version }}.tar.gz
21
 
21
 
22
 - name: Decompress znc source
22
 - name: Decompress znc source
23
-  command: tar xzf /root/znc-${znc_version}.tar.gz chdir=/root creates=/root/znc-${znc_version}/configure
23
+  command: tar xzf /root/znc-{{ znc_version }}.tar.gz chdir=/root creates=/root/znc-{{ znc_version }}/configure
24
 
24
 
25
 - name: Build and install znc
25
 - name: Build and install znc
26
-  shell: ./configure --enable-python ; make ; make install executable=/bin/bash chdir=/root/znc-${znc_version} creates=/usr/local/bin/znc
26
+  shell: ./configure --enable-python ; make ; make install executable=/bin/bash chdir=/root/znc-{{ znc_version }} creates=/usr/local/bin/znc
27
 
27
 
28
 - name: Create znc group
28
 - name: Create znc group
29
   group: name=znc state=present
29
   group: name=znc state=present

+ 5
- 5
roles/mailserver/tasks/dovecot.yml View File

15
   user: name=vmail group=vmail state=present uid=5000 home=/decrypted
15
   user: name=vmail group=vmail state=present uid=5000 home=/decrypted
16
 
16
 
17
 - name: Ensure mail domain directories are in place
17
 - name: Ensure mail domain directories are in place
18
-  file: state=directory path=/decrypted/${item.name} owner=vmail group=dovecot mode=770
18
+  file: state=directory path=/decrypted/{{ item.name }} owner=vmail group=dovecot mode=770
19
   with_items:
19
   with_items:
20
-    - ${mail_virtual_domains}
20
+    - {{ mail_virtual_domains }}
21
 
21
 
22
 - name: Ensure mail directories are in place
22
 - name: Ensure mail directories are in place
23
-  file: state=directory path=/decrypted/${item.name}/${item.primary_user} owner=vmail group=dovecot
23
+  file: state=directory path=/decrypted/{{ item.name }}/{{ item.primary_user }} owner=vmail group=dovecot
24
   with_items:
24
   with_items:
25
-    - ${mail_virtual_domains}
25
+    - {{ mail_virtual_domains }}
26
 
26
 
27
 - name: Copy dovecot.conf into place
27
 - name: Copy dovecot.conf into place
28
   copy: src=etc_dovecot_dovecot.conf dest=/etc/dovecot/dovecot.conf
28
   copy: src=etc_dovecot_dovecot.conf dest=/etc/dovecot/dovecot.conf
29
 
29
 
30
 - name: Copy additional Dovecot configuration files in place
30
 - name: Copy additional Dovecot configuration files in place
31
-  copy: src=etc_dovecot_conf.d_${item} dest=/etc/dovecot/conf.d/${item}
31
+  copy: src=etc_dovecot_conf.d_{{ item }} dest=/etc/dovecot/conf.d/{{ item }}
32
   with_items:
32
   with_items:
33
     - 10-mail.conf
33
     - 10-mail.conf
34
     - 10-auth.conf
34
     - 10-auth.conf

+ 4
- 4
roles/mailserver/tasks/dspam.yml View File

10
   file: state=directory path=/decrypted/dspam group=dspam owner=dspam
10
   file: state=directory path=/decrypted/dspam group=dspam owner=dspam
11
 
11
 
12
 - name: Put dspam configuration files in place
12
 - name: Put dspam configuration files in place
13
-  copy: src=etc_dspam_{{item}} dest=/etc/dspam/{{item}} owner=dspam group=dspam
13
+  copy: src=etc_dspam_{{ item }} dest=/etc/dspam/{{ item }} owner=dspam group=dspam
14
   with_items:
14
   with_items:
15
     - default.prefs
15
     - default.prefs
16
     - dspam.conf
16
     - dspam.conf
23
   notify: restart postfix
23
   notify: restart postfix
24
 
24
 
25
 - name: Put dspam dovecot configuration in place
25
 - name: Put dspam dovecot configuration in place
26
-  copy: src=etc_dovecot_conf.d_{{item}} dest=/etc/dovecot/conf.d/{{item}} owner=vmail group=dovecot
26
+  copy: src=etc_dovecot_conf.d_{{ item }} dest=/etc/dovecot/conf.d/{{ item }} owner=vmail group=dovecot
27
   with_items:
27
   with_items:
28
     - 20-imap.conf
28
     - 20-imap.conf
29
     - 90-plugin.conf
29
     - 90-plugin.conf
30
   notify: restart dovecot
30
   notify: restart dovecot
31
 
31
 
32
 - name: Put sieve rules into each primary user directory
32
 - name: Put sieve rules into each primary user directory
33
-  copy: src=dot_dovecot.sieve dest=/decrypted/${item.name}/${item.primary_user}/.dovecot.sieve owner=vmail group=dovecot
33
+  copy: src=dot_dovecot.sieve dest=/decrypted/{{ item.name }}/{{ item.primary_user }}/.dovecot.sieve owner=vmail group=dovecot
34
   with_items:
34
   with_items:
35
-    - ${mail_virtual_domains}
35
+    - {{ mail_virtual_domains }}
36
   notify: restart dovecot
36
   notify: restart dovecot

+ 6
- 6
roles/mailserver/tasks/opendkim.yml View File

7
     - opendkim
7
     - opendkim
8
     - opendkim-tools
8
     - opendkim-tools
9
 
9
 
10
-- name: Create OpenDKIM config directory 
10
+- name: Create OpenDKIM config directory
11
   file: state=directory path=/etc/opendkim group=opendkim owner=opendkim
11
   file: state=directory path=/etc/opendkim group=opendkim owner=opendkim
12
 
12
 
13
 - name: Create OpenDKIM key directories
13
 - name: Create OpenDKIM key directories
14
-  file: state=directory path=/etc/opendkim/keys/${item.name} group=opendkim owner=opendkim
14
+  file: state=directory path=/etc/opendkim/keys/{{ item.name }} group=opendkim owner=opendkim
15
   with_items:
15
   with_items:
16
-    - ${mail_virtual_domains}
16
+    - {{ mail_virtual_domains }}
17
 
17
 
18
 - name: Generate OpenDKIM keys
18
 - name: Generate OpenDKIM keys
19
-  command: opendkim-genkey -r -d ${item.name} -D /etc/opendkim/keys/${item.name}/ creates=/etc/opendkim/keys/${item.name}/default.private
19
+  command: opendkim-genkey -r -d {{ item.name }} -D /etc/opendkim/keys/{{ item.name }}/ creates=/etc/opendkim/keys/{{ item.name }}/default.private
20
   with_items:
20
   with_items:
21
-    - ${mail_virtual_domains}
21
+    - {{ mail_virtual_domains }}
22
 
22
 
23
 - name: Put opendkim.conf into place
23
 - name: Put opendkim.conf into place
24
   copy: src=etc_opendkim.conf dest=/etc/opendkim.conf owner=opendkim group=opendkim
24
   copy: src=etc_opendkim.conf dest=/etc/opendkim.conf owner=opendkim group=opendkim
27
     - restart postfix
27
     - restart postfix
28
 
28
 
29
 - name: Put additional OpenDKIM configuration files into place
29
 - name: Put additional OpenDKIM configuration files into place
30
-  template: src=etc_opendkim_{{item}}.j2 dest=/etc/opendkim/{{item}} owner=opendkim group=opendkim
30
+  template: src=etc_opendkim_{{ item }}.j2 dest=/etc/opendkim/{{ item }} owner=opendkim group=opendkim
31
   with_items:
31
   with_items:
32
     - KeyTable
32
     - KeyTable
33
     - SigningTable
33
     - SigningTable

+ 1
- 1
roles/mailserver/tasks/postfix.yml View File

30
   notify: restart postfix
30
   notify: restart postfix
31
 
31
 
32
 - name: Copy additional postfix configuration files
32
 - name: Copy additional postfix configuration files
33
-  template: src=etc_postfix_${item}.j2 dest=/etc/postfix/${item} owner=root group=root
33
+  template: src=etc_postfix_{{ item }}.j2 dest=/etc/postfix/{{ item }} owner=root group=root
34
   with_items:
34
   with_items:
35
     - mysql-virtual-mailbox-domains.cf
35
     - mysql-virtual-mailbox-domains.cf
36
     - mysql-virtual-mailbox-maps.cf
36
     - mysql-virtual-mailbox-maps.cf

+ 6
- 8
roles/mailserver/templates/etc_postfix_main.cf.j2 View File

1
 # See /usr/share/postfix/main.cf.dist for a commented, more complete version
1
 # See /usr/share/postfix/main.cf.dist for a commented, more complete version
2
 # Modified as per http://sealedabstract.com/code/nsa-proof-your-e-mail-in-2-hours/
2
 # Modified as per http://sealedabstract.com/code/nsa-proof-your-e-mail-in-2-hours/
3
- 
3
+
4
 smtpd_banner = $myhostname ESMTP $mail_name
4
 smtpd_banner = $myhostname ESMTP $mail_name
5
 biff = no
5
 biff = no
6
- 
6
+
7
 # Accept messages up to 50MB
7
 # Accept messages up to 50MB
8
 message_size_limit = 51200000
8
 message_size_limit = 51200000
9
 
9
 
10
 # appending .domain is the MUA's job.
10
 # appending .domain is the MUA's job.
11
 append_dot_mydomain = no
11
 append_dot_mydomain = no
12
- 
12
+
13
 # Uncomment the next line to generate "delayed mail" warnings
13
 # Uncomment the next line to generate "delayed mail" warnings
14
 #delay_warning_time = 4h
14
 #delay_warning_time = 4h
15
- 
15
+
16
 readme_directory = no
16
 readme_directory = no
17
 
17
 
18
 # antispam
18
 # antispam
34
 unknown_virtual_mailbox_reject_code = 554
34
 unknown_virtual_mailbox_reject_code = 554
35
 unverified_recipient_reject_code = 554
35
 unverified_recipient_reject_code = 554
36
 unverified_sender_reject_code = 554
36
 unverified_sender_reject_code = 554
37
- 
37
+
38
 # TLS parameters
38
 # TLS parameters
39
 smtpd_tls_cert_file=/etc/ssl/certs/wildcard_combined.pem
39
 smtpd_tls_cert_file=/etc/ssl/certs/wildcard_combined.pem
40
 smtpd_tls_key_file=/etc/ssl/private/wildcard_private.key
40
 smtpd_tls_key_file=/etc/ssl/private/wildcard_private.key
41
 smtpd_use_tls=yes
41
 smtpd_use_tls=yes
42
-#smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
43
-#smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
44
 smtpd_tls_auth_only = yes
42
 smtpd_tls_auth_only = yes
45
 smtp_tls_security_level = may
43
 smtp_tls_security_level = may
46
 smtp_tls_loglevel = 2
44
 smtp_tls_loglevel = 2
68
 
66
 
69
 # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
67
 # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
70
 # information on enabling SSL in the smtp client.
68
 # information on enabling SSL in the smtp client.
71
- 
69
+
72
 myhostname = {{ mail_server_hostname }}
70
 myhostname = {{ mail_server_hostname }}
73
 myorigin = $mydomain
71
 myorigin = $mydomain
74
 alias_maps = hash:/etc/aliases
72
 alias_maps = hash:/etc/aliases

+ 1
- 1
roles/monitoring/tasks/monit.yml View File

5
   copy: src=etc_monit_monitrc dest=/etc/monit/monitrc
5
   copy: src=etc_monit_monitrc dest=/etc/monit/monitrc
6
 
6
 
7
 - name: Copy monit service config files into place
7
 - name: Copy monit service config files into place
8
-  copy: src=etc_monit_conf.d_${item} dest=/etc/monit/conf.d/${item}
8
+  copy: src=etc_monit_conf.d_{{ item }} dest=/etc/monit/conf.d/{{ item }}
9
   with_items:
9
   with_items:
10
     - apache2
10
     - apache2
11
     - dovecot
11
     - dovecot

+ 13
- 13
roles/tarsnap/tasks/tarsnap.yml View File

14
   command:
14
   command:
15
     gpg --import tarsnap-signing-key.asc
15
     gpg --import tarsnap-signing-key.asc
16
     chdir=/root/
16
     chdir=/root/
17
-    
17
+
18
 - name: Download tarsnap SHA file
18
 - name: Download tarsnap SHA file
19
   get_url:
19
   get_url:
20
-    url="https://www.tarsnap.com/download/tarsnap-sigs-{{tarsnap_version}}.asc"
21
-    dest="/root/tarsnap-sigs-{{tarsnap_version}}.asc"
22
-    
20
+    url="https://www.tarsnap.com/download/tarsnap-sigs-{{ tarsnap_version }}.asc"
21
+    dest="/root/tarsnap-sigs-{{ tarsnap_version }}.asc"
22
+
23
 - name: Make the command that gets the current sha
23
 - name: Make the command that gets the current sha
24
   template:
24
   template:
25
     src=getSha.sh
25
     src=getSha.sh
26
     dest=/root/getSha.sh
26
     dest=/root/getSha.sh
27
     mode=0755
27
     mode=0755
28
-    
28
+
29
 - name: get the SHA256sum for this tarsnap release
29
 - name: get the SHA256sum for this tarsnap release
30
   command:
30
   command:
31
     ./getSha.sh
31
     ./getSha.sh
32
     chdir=/root
32
     chdir=/root
33
   register: tarsnap_sha
33
   register: tarsnap_sha
34
-  
34
+
35
 - name: Download Tarsnap source
35
 - name: Download Tarsnap source
36
   get_url:
36
   get_url:
37
-    url="https://www.tarsnap.com/download/tarsnap-autoconf-{{tarsnap_version}}.tgz"
38
-    dest="/root/tarsnap-autoconf-{{tarsnap_version}}.tgz"
39
-    sha256sum={{tarsnap_sha.stdout_lines[0]}}
40
-    
37
+    url="https://www.tarsnap.com/download/tarsnap-autoconf-{{ tarsnap_version }}.tgz"
38
+    dest="/root/tarsnap-autoconf-{{ tarsnap_version }}.tgz"
39
+    sha256sum={{ tarsnap_sha.stdout_lines[0] }}
40
+
41
 
41
 
42
 - name: Decompress Tarsnap source
42
 - name: Decompress Tarsnap source
43
-  command: tar xzf /root/tarsnap-autoconf-${tarsnap_version}.tgz chdir=/root creates=/root/tarsnap-autoconf-${tarsnap_version}/COPYING
43
+  command: tar xzf /root/tarsnap-autoconf-{{ tarsnap_version }}.tgz chdir=/root creates=/root/tarsnap-autoconf-{{ tarsnap_version }}/COPYING
44
 
44
 
45
 - name: Configure Tarsnap for local build
45
 - name: Configure Tarsnap for local build
46
-  command: ./configure chdir=/root/tarsnap-autoconf-${tarsnap_version} creates=/root/tarsnap-autoconf-${tarsnap_version}/Makefile
46
+  command: ./configure chdir=/root/tarsnap-autoconf-{{ tarsnap_version }} creates=/root/tarsnap-autoconf-{{ tarsnap_version }}/Makefile
47
 
47
 
48
 - name: Build and install Tarsnap
48
 - name: Build and install Tarsnap
49
-  command: make all install clean chdir=/root/tarsnap-autoconf-${tarsnap_version} creates=/usr/local/bin/tarsnap
49
+  command: make all install clean chdir=/root/tarsnap-autoconf-{{ tarsnap_version }} creates=/usr/local/bin/tarsnap
50
 
50
 
51
 - name: Copy Tarsnap key file into place
51
 - name: Copy Tarsnap key file into place
52
   copy: src=root_tarsnap.key dest=/root/tarsnap.key owner=root group=root
52
   copy: src=root_tarsnap.key dest=/root/tarsnap.key owner=root group=root

+ 1
- 1
roles/tarsnap/templates/getSha.sh View File

1
 #!/bin/bash
1
 #!/bin/bash
2
-gpgResult=`gpg --decrypt tarsnap-sigs-{{tarsnap_version}}.asc`
2
+gpgResult=`gpg --decrypt tarsnap-sigs-{{ tarsnap_version }}.asc`
3
 sha=${gpgResult#*=}
3
 sha=${gpgResult#*=}
4
 echo $sha > /root/tarsnapSha
4
 echo $sha > /root/tarsnapSha
5
 echo $sha
5
 echo $sha

Loading…
Cancel
Save