diff --git a/defaults/main.yml b/defaults/main.yml index e69de29..02ee5aa 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -0,0 +1 @@ +php_extention_enable: [] \ No newline at end of file diff --git a/handlers/main.yml b/handlers/main.yml index e69de29..07dd7ce 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -0,0 +1,4 @@ +--- +- name: reload_php_fpm + service: name=php-fpm state=restarted + become: yes \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index e69de29..6123088 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -0,0 +1,20 @@ +--- +- name: Ensure php is installed. + pacman: + name: + - php + - php-fpm + state: present + become: yes +- name: Ensure php-fpm is started and enabled to start at boot. + service: name=php-fpm state=started enabled=yes + become: yes + +- name: enable php extetion + become: true + lineinfile: + dest: /etc/php/php.ini + regexp: ";extension={{item}}" + line: "extension={{item}}" + with_items: "{{php_extention_enable}}" + notify: reload_php_fpm \ No newline at end of file