Skip to content

Commit e7f0022

Browse files
committed
Use yml dictionaries for "lineinfile" to increase readabylity
1 parent fb1dd53 commit e7f0022

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
---
22
- name: enabling opcache cli
3-
lineinfile: dest=/etc/php/7.0/cli/php.ini
4-
regexp=';?opcache.enable=\d'
5-
line='opcache.enable=1'
3+
lineinfile:
4+
dest: /etc/php/7.0/cli/php.ini
5+
regexp: ';?opcache.enable=\d'
6+
line: 'opcache.enable=1'
67

78
- name: ensure timezone is set in cli php.ini
8-
lineinfile: dest=/etc/php/7.0/cli/php.ini
9-
regexp='date.timezone ='
10-
line='date.timezone = {{ server.timezone }}'
9+
lineinfile:
10+
dest: /etc/php/7.0/cli/php.ini
11+
regexp: 'date.timezone ='
12+
line: 'date.timezone = {{ server.timezone }}'

ansible/roles/vagrant_local/tasks/main.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@
88
when: vagrant_local.vm.hostname is defined
99

1010
- name: Update /etc/hosts
11-
lineinfile: dest=/etc/hosts regexp='^127\.0\.0\.1' line='127.0.0.1 localhost {{ vagrant_local.vm.hostname }}' owner=root group=root mode=0644
11+
lineinfile:
12+
dest: /etc/hosts
13+
regexp: '^127\.0\.0\.1'
14+
line: '127.0.0.1 localhost {{ vagrant_local.vm.hostname }}'
15+
owner: root
16+
group: root
17+
mode: 0644

0 commit comments

Comments
 (0)