Mercurial > hg > Members > anatofuz > wordpress_ansible
changeset 22:090c14a0be80
loop to vars
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 02 Sep 2020 23:05:36 +0900 |
parents | 0db847234dbe |
children | 71c5fd5fa109 |
files | roles/install-firewalld/tasks/main.yml roles/install-mariadb/tasks/main.yml roles/install-php/tasks/main.yml |
diffstat | 3 files changed, 21 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/roles/install-firewalld/tasks/main.yml Wed Sep 02 22:12:33 2020 +0900 +++ b/roles/install-firewalld/tasks/main.yml Wed Sep 02 23:05:36 2020 +0900 @@ -9,12 +9,13 @@ - name: Setting Firewalld become: yes firewalld: - service: "{{ item }}" + service: "{{ packages }}" zone: FedoraServer permanent: yes state: enabled - loop: - - http - - https + vars: + packages: + - http + - https changed_when: True notify: restart_firewalld
--- a/roles/install-mariadb/tasks/main.yml Wed Sep 02 22:12:33 2020 +0900 +++ b/roles/install-mariadb/tasks/main.yml Wed Sep 02 23:05:36 2020 +0900 @@ -2,14 +2,14 @@ - name: install dnf packages become: yes dnf: - name: - - "{{ item }}" + name: "{{ packages }}" state: latest - loop: - - mariadb - - mariadb-server - - MySQL-python3 - - python3-libselinux + vars: + packages: + - mariadb + - mariadb-server + - MySQL-python3 + - python3-libselinux - name: start and enabled mariadb become: yes
--- a/roles/install-php/tasks/main.yml Wed Sep 02 22:12:33 2020 +0900 +++ b/roles/install-php/tasks/main.yml Wed Sep 02 23:05:36 2020 +0900 @@ -1,11 +1,13 @@ +--- + - name: install php packages become: yes dnf: - name: - - "{{ item }}" + name: "{{ packages }}" state: latest - loop: - - php - - php-mysqlnd - - php-mbstring - - php-fpm + vars: + packages: + - php + - php-mysqlnd + - php-mbstring + - php-fpm