Skip to content

Commit cfff327

Browse files
committed
Remove sudo and become from roles and use one become in playbook
1 parent fda3dd4 commit cfff327

File tree

5 files changed

+6
-25
lines changed

5 files changed

+6
-25
lines changed

ansible/playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- hosts: all
3-
sudo: true
3+
become: yes
44
vars_files:
55
- vars/all.yml
66
roles:

ansible/roles/app/tasks/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
22
# application tasks to be customized and to run after the main provision
33
- name: update file db
4-
sudo: yes
54
shell: updatedb

ansible/roles/php/tasks/main.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,19 @@
11
---
22
- name: Update apt
3-
become: yes
43
apt: update_cache=yes autoremove=yes
54

65
- name: Add ppa Repository
7-
sudo: yes
86
apt_repository: repo=ppa:ondrej/{{ php.ppa }}
97

108
- name: Update apt
11-
sudo: yes
129
apt: update_cache=yes
1310

1411
- name: Install php7
15-
sudo: yes
1612
apt: pkg=php7.0 state=latest
1713

1814
- name: Install PHP Packages
19-
sudo: yes
20-
apt: pkg={{ item }} state=latest
21-
with_items: '{{ php.packages }}'
15+
apt: pkg="{{ item }}" state=latest
16+
with_items: "{{ php.packages }}"
2217
when: php.packages is defined
2318

24-
- name: Install PHP PECL Packages
25-
become: yes
26-
apt: pkg={{ item }} state=latest force=yes
27-
with_items: '{{ php.pecl_packages }}'
28-
when: php.pecl_packages is defined
29-
3019
- include: configure.yml
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
11
---
22
- name: Update apt
3-
sudo: yes
43
apt: update_cache=yes
54

65
- name: Install System Packages
7-
sudo: yes
8-
apt: pkg={{ item }} state=latest
6+
apt: pkg="{{ item }}" state=latest
97
with_items:
108
- curl
119
- wget
1210
- python-software-properties
1311

1412
- name: Install Extra Packages
15-
sudo: yes
16-
apt: pkg={{ item }} state=latest
17-
with_items: server.packages
13+
apt: pkg="{{ item }}" state=latest
14+
with_items: "{{ server.packages }}"
1815
when: server.packages is defined
1916

2017
- name: Configure the timezone
21-
sudo: yes
2218
template: src=timezone.tpl dest=/etc/timezone
2319

2420
- name: More Configure the timezone
25-
sudo: yes
2621
file: src=/usr/share/zoneinfo/{{server.timezone}} dest=/etc/localtime state=link force=yes backup=yes
2722

2823
- name: Set default system language pack
2924
shell: locale-gen {{server.locale}}
30-
sudo: yes
3125

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
---
22
- name: Install xDebug
3-
sudo: yes
43
apt: pkg=php5-xdebug state=latest

0 commit comments

Comments
 (0)