Remove sudo and become from roles and use one become in playbook

This commit is contained in:
Nikita Strelkov
2016-10-05 21:25:16 +05:00
parent fda3dd4584
commit cfff327fb2
5 changed files with 6 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
--- ---
- hosts: all - hosts: all
sudo: true become: yes
vars_files: vars_files:
- vars/all.yml - vars/all.yml
roles: roles:

View File

@@ -1,5 +1,4 @@
--- ---
# application tasks to be customized and to run after the main provision # application tasks to be customized and to run after the main provision
- name: update file db - name: update file db
sudo: yes
shell: updatedb shell: updatedb

View File

@@ -1,30 +1,19 @@
--- ---
- name: Update apt - name: Update apt
become: yes
apt: update_cache=yes autoremove=yes apt: update_cache=yes autoremove=yes
- name: Add ppa Repository - name: Add ppa Repository
sudo: yes
apt_repository: repo=ppa:ondrej/{{ php.ppa }} apt_repository: repo=ppa:ondrej/{{ php.ppa }}
- name: Update apt - name: Update apt
sudo: yes
apt: update_cache=yes apt: update_cache=yes
- name: Install php7 - name: Install php7
sudo: yes
apt: pkg=php7.0 state=latest apt: pkg=php7.0 state=latest
- name: Install PHP Packages - name: Install PHP Packages
sudo: yes apt: pkg="{{ item }}" state=latest
apt: pkg={{ item }} state=latest with_items: "{{ php.packages }}"
with_items: '{{ php.packages }}'
when: php.packages is defined when: php.packages is defined
- name: Install PHP PECL Packages
become: yes
apt: pkg={{ item }} state=latest force=yes
with_items: '{{ php.pecl_packages }}'
when: php.pecl_packages is defined
- include: configure.yml - include: configure.yml

View File

@@ -1,31 +1,25 @@
--- ---
- name: Update apt - name: Update apt
sudo: yes
apt: update_cache=yes apt: update_cache=yes
- name: Install System Packages - name: Install System Packages
sudo: yes apt: pkg="{{ item }}" state=latest
apt: pkg={{ item }} state=latest
with_items: with_items:
- curl - curl
- wget - wget
- python-software-properties - python-software-properties
- name: Install Extra Packages - name: Install Extra Packages
sudo: yes apt: pkg="{{ item }}" state=latest
apt: pkg={{ item }} state=latest with_items: "{{ server.packages }}"
with_items: server.packages
when: server.packages is defined when: server.packages is defined
- name: Configure the timezone - name: Configure the timezone
sudo: yes
template: src=timezone.tpl dest=/etc/timezone template: src=timezone.tpl dest=/etc/timezone
- name: More Configure the timezone - name: More Configure the timezone
sudo: yes
file: src=/usr/share/zoneinfo/{{server.timezone}} dest=/etc/localtime state=link force=yes backup=yes file: src=/usr/share/zoneinfo/{{server.timezone}} dest=/etc/localtime state=link force=yes backup=yes
- name: Set default system language pack - name: Set default system language pack
shell: locale-gen {{server.locale}} shell: locale-gen {{server.locale}}
sudo: yes

View File

@@ -1,4 +1,3 @@
--- ---
- name: Install xDebug - name: Install xDebug
sudo: yes
apt: pkg=php5-xdebug state=latest apt: pkg=php5-xdebug state=latest