Mercurial > hg > Members > anatofuz > wordpress_ansible
changeset 14:78ce5b9c6d8f
move tasks to roles
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 02 Sep 2020 15:14:47 +0900 |
parents | 0331a4ed161b |
children | 177c28bf6e05 |
files | roles/install-wordpress/tasks/main.yml tasks/setting-wordpress.yml |
diffstat | 2 files changed, 43 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/roles/install-wordpress/tasks/main.yml Wed Sep 02 15:14:47 2020 +0900 @@ -0,0 +1,43 @@ +--- + - 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: 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: 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: 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='password_here' replace='hZzTwWuTeN' + + - name: httpd restart + service: name=httpd state=restarted + become: yes
--- a/tasks/setting-wordpress.yml Wed Sep 02 15:10:34 2020 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ - - 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: 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: 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: 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='password_here' replace='hZzTwWuTeN' - - - name: httpd restart - service: name=httpd state=restarted - become: yes