Browse Source

Quote password variables (they may contain spaces)

String-valued variables containing spaces can be substituted into an ansible
tasks file but they will not be interpreted correctly.
Allen Riddell 11 years ago
parent
commit
d1e9e2b4ff

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

15
   notify: import sql postfix
15
   notify: import sql postfix
16
 
16
 
17
 - name: Create database user for mail server
17
 - name: Create database user for mail server
18
-  postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password={{ db_admin_password }} name={{ mail_db_username }} password={{ mail_db_password }} state=present
18
+  postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ mail_db_username }} password="{{ mail_db_password }}" state=present
19
   notify: import sql postfix
19
   notify: import sql postfix
20
 
20
 
21
 - name: Create database for mail server
21
 - name: Create database for mail server
22
-  postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password={{ db_admin_password }} name={{ mail_db_database }} state=present owner={{ mail_db_username }}
22
+  postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ mail_db_database }} state=present owner={{ mail_db_username }}
23
   notify: import sql postfix
23
   notify: import sql postfix
24
 
24
 
25
 - name: Copy import.sql
25
 - name: Copy import.sql

+ 2
- 2
roles/news/tasks/selfoss.yml View File

6
   action: file owner=www-data group=www-data path=/var/www/selfoss recurse=yes state=directory
6
   action: file owner=www-data group=www-data path=/var/www/selfoss recurse=yes state=directory
7
 
7
 
8
 - name: Create database user for selfoss
8
 - name: Create database user for selfoss
9
-  postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password={{ db_admin_password }} name={{ selfoss_db_username }} password={{ selfoss_db_password }} state=present
9
+  postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ selfoss_db_username }} password="{{ selfoss_db_password }}" state=present
10
 
10
 
11
 - name: Create database for selfoss
11
 - name: Create database for selfoss
12
-  postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password={{ db_admin_password }} name={{ selfoss_db_database }} state=present owner={{ selfoss_db_username }}
12
+  postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ selfoss_db_database }} state=present owner={{ selfoss_db_username }}
13
 
13
 
14
 - name: Install selfoss config.ini
14
 - name: Install selfoss config.ini
15
   template: src=var_www_selfoss_config.ini.j2 dest=/var/www/selfoss/config.ini group=www-data owner=www-data
15
   template: src=var_www_selfoss_config.ini.j2 dest=/var/www/selfoss/config.ini group=www-data owner=www-data

+ 2
- 2
roles/owncloud/tasks/owncloud.yml View File

3
 # as per http://www.debiantutorials.com/how-to-install-owncloud-on-wheezy/
3
 # as per http://www.debiantutorials.com/how-to-install-owncloud-on-wheezy/
4
 
4
 
5
 - name: Create database user for ownCloud
5
 - name: Create database user for ownCloud
6
-  postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password={{ db_admin_password }} name={{ owncloud_db_username }} password={{ owncloud_db_password }} state=present
6
+  postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ owncloud_db_username }} password="{{ owncloud_db_password }}" state=present
7
 
7
 
8
 - name: Create database for ownCloud
8
 - name: Create database for ownCloud
9
-  postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password={{ db_admin_password }} name={{ owncloud_db_database }} state=present owner={{ owncloud_db_username }}
9
+  postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ owncloud_db_database }} state=present owner={{ owncloud_db_username }}
10
 
10
 
11
 - name: Ensure repository key for ownCloud is in place
11
 - name: Ensure repository key for ownCloud is in place
12
   apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/Release.key state=present
12
   apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/Release.key state=present

+ 1
- 1
roles/xmpp/tasks/prosody.yml View File

18
   notify: restart prosody
18
   notify: restart prosody
19
 
19
 
20
 - name: Create Prosody accounts
20
 - name: Create Prosody accounts
21
-  command: prosodyctl register {{ item.name }} {{ prosody_virtual_domain }} {{ item.password }}
21
+  command: prosodyctl register {{ item.name }} {{ prosody_virtual_domain }} "{{ item.password }}"
22
   with_items: prosody_accounts
22
   with_items: prosody_accounts

Loading…
Cancel
Save