Mercurial > hg > Members > anatofuz > wordpress_ansible
changeset 15:177c28bf6e05
twak install-wordpress/tasks/main.yml
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 02 Sep 2020 15:22:32 +0900 |
parents | 78ce5b9c6d8f |
children | c0313aebc975 |
files | roles/install-wordpress/tasks/main.yml |
diffstat | 1 files changed, 21 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/roles/install-wordpress/tasks/main.yml Wed Sep 02 15:14:47 2020 +0900 +++ b/roles/install-wordpress/tasks/main.yml Wed Sep 02 15:22:32 2020 +0900 @@ -1,43 +1,28 @@ --- - - name: WordPress Download - get_url: url="https://ja.wordpress.org/wordpress-5.2.3-ja.tar.gz" dest=/tmp - - - name: unarchive source - become: yes - command: tar zxvf /tmp/wordpress-5.2.3-ja.tar.gz chdir=/var/www/html +- name: get and unarchive source + become: yes + unarchive: + src: https://ja.wordpress.org/latest-ja.tar.gz + dest: /var/www/html - - name: change dir / files permission - become: yes - file: path=/var/www/html/wordpress owner=apache group=apache mode=0755 recurse=yes state=directory - - - name: replace /etc/httpd/conf/httpd.conf - become: yes - replace: dest=/etc/httpd/conf/httpd.conf regexp='^DocumentRoot "/var/www/html"$' replace='DocumentRoot "/var/www/html/wordpress"' backup=yes - - - name: replace /etc/httpd/conf/httpd.conf - become: yes - replace: dest=/etc/httpd/conf/httpd.conf regexp='^<Directory "/var/www">$' replace='<Directory "/var/www/wordpress">' backup=yes +- name: change dir / files permission + become: yes + file: path=/var/www/html/wordpress owner=apache group=apache mode=0755 recurse=yes state=directory - - name: replace /etc/httpd/conf/httpd.conf - become: yes - replace: dest=/etc/httpd/conf/httpd.conf regexp='^AllowOverride None$' replace='AllowOverride All' backup=yes +- name: cp wp-config.php + become: yes + command: cp '/var/www/html/wordpress/wp-config-sample.php' '/var/www/html/wordpress/wp-config.php' creates=/var/www/html/wordpress/wp-config.php - - name: cp wp-config.php - become: yes - command: cp '/var/www/html/wordpress/wp-config-sample.php' '/var/www/html/wordpress/wp-config.php' creates=/var/www/html/wordpress/wp-config.php - - - name: replace /var/www/html/wordpress/wp-config.php - become: yes - replace: dest=/var/www/html/wordpress/wp-config.php regexp='database_name_here' replace='wordpress' +- name: replace /var/www/html/wordpress/wp-config.php + become: yes + replace: dest=/var/www/html/wordpress/wp-config.php regexp='database_name_here' replace='wordpress' - - name: replace /var/www/html/wordpress/wp-config.php - become: yes - replace: dest=/var/www/html/wordpress/wp-config.php regexp='username_here' replace='wordpress' +- name: replace /var/www/html/wordpress/wp-config.php + become: yes + replace: dest=/var/www/html/wordpress/wp-config.php regexp='username_here' replace='wordpress' - - name: replace /var/www/html/wordpress/wp-config.php - become: yes - replace: dest=/var/www/html/wordpress/wp-config.php regexp='password_here' replace='hZzTwWuTeN' +- name: replace /var/www/html/wordpress/wp-config.php + become: yes + replace: dest=/var/www/html/wordpress/wp-config.php regexp='password_here' replace='hZzTwWuTeN' + notify: restart_nginx - - name: httpd restart - service: name=httpd state=restarted - become: yes