mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Update install.yml
This commit is contained in:
parent
35d0bd9701
commit
341580d6c9
1 changed files with 18 additions and 18 deletions
|
@ -11,7 +11,7 @@
|
||||||
# and security enhancements using timestamps under /library/wordpress, as these
|
# and security enhancements using timestamps under /library/wordpress, as these
|
||||||
# can arise without warning when WordPress is online, since WordPress ~4.8
|
# can arise without warning when WordPress is online, since WordPress ~4.8
|
||||||
|
|
||||||
- name: Download the latest WordPress software
|
- name: Download {{ wordpress_download_base_url }}/{{ wordpress_src }} to {{ downloads_dir }}
|
||||||
get_url:
|
get_url:
|
||||||
url: "{{ wordpress_download_base_url }}/{{ wordpress_src }}"
|
url: "{{ wordpress_download_base_url }}/{{ wordpress_src }}"
|
||||||
dest: "{{ downloads_dir }}"
|
dest: "{{ downloads_dir }}"
|
||||||
|
@ -21,14 +21,14 @@
|
||||||
register: wp_download_output
|
register: wp_download_output
|
||||||
when: internet_available
|
when: internet_available
|
||||||
|
|
||||||
- name: Create link /opt/iiab/downloads/wordpress.tar.gz pointing to {{ wp_download_output.dest }}
|
- name: Create symlink from /opt/iiab/downloads/wordpress.tar.gz to {{ wp_download_output.dest }}
|
||||||
file:
|
file:
|
||||||
src: "{{ wp_download_output.dest }}"
|
src: "{{ wp_download_output.dest }}"
|
||||||
dest: "{{ downloads_dir }}/wordpress.tar.gz"
|
path: "{{ downloads_dir }}/wordpress.tar.gz"
|
||||||
state: link
|
state: link
|
||||||
when: wp_download_output.dest is defined
|
when: wp_download_output.dest is defined
|
||||||
|
|
||||||
- name: Check if /opt/iiab/downloads/wordpress.tar.gz link exists
|
- name: Does /opt/iiab/downloads/wordpress.tar.gz link exist?
|
||||||
stat:
|
stat:
|
||||||
path: "{{ downloads_dir }}/wordpress.tar.gz"
|
path: "{{ downloads_dir }}/wordpress.tar.gz"
|
||||||
register: wp_link
|
register: wp_link
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
- name: Make /library/wordpress directories 775 so Apache can traverse and write (most files remain 0664)
|
- name: Make /library/wordpress directories 775 so Apache can traverse and write (most files remain 0664)
|
||||||
command: "/usr/bin/find {{ wp_abs_path }} -type d -exec chmod 775 {} +"
|
command: "/usr/bin/find {{ wp_abs_path }} -type d -exec chmod 775 {} +"
|
||||||
|
|
||||||
- name: Copy wp salt values
|
- name: Install {{ wp_abs_path }}/wp-keys.php.BAK
|
||||||
copy:
|
copy:
|
||||||
src: wp-keys.php.BAK
|
src: wp-keys.php.BAK
|
||||||
dest: "{{ wp_abs_path }}/wp-keys.php.BAK"
|
dest: "{{ wp_abs_path }}/wp-keys.php.BAK"
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
|
|
||||||
# Fetch random salts for WordPress config into wp-keys.php file by generating script and running
|
# Fetch random salts for WordPress config into wp-keys.php file by generating script and running
|
||||||
|
|
||||||
- name: Create wp salt script
|
- name: Install script /tmp/get-iiab-wp-salts from template
|
||||||
template:
|
template:
|
||||||
src: get-iiab-wp-salts.j2
|
src: get-iiab-wp-salts.j2
|
||||||
dest: /tmp/get-iiab-wp-salts
|
dest: /tmp/get-iiab-wp-salts
|
||||||
|
@ -79,20 +79,20 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0700
|
mode: 0700
|
||||||
|
|
||||||
- name: Run wp salt script to create /library/wordpress/wp-keys.php
|
- name: Run /tmp/get-iiab-wp-salts to create /library/wordpress/wp-keys.php
|
||||||
command: /tmp/get-iiab-wp-salts
|
command: /tmp/get-iiab-wp-salts
|
||||||
|
|
||||||
- name: Cleanup - remove wp salt script
|
- name: Remove script /tmp/get-iiab-wp-salts
|
||||||
file:
|
file:
|
||||||
path: /tmp/get-iiab-wp-salts
|
path: /tmp/get-iiab-wp-salts
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: MySQL database needs to be running if we are trying to create a new db
|
- name: Start MySQL systemd service
|
||||||
service:
|
service:
|
||||||
state: started
|
state: started
|
||||||
name: "{{ mysql_service }}"
|
name: "{{ mysql_service }}"
|
||||||
|
|
||||||
- name: Create MySQL wordpress database
|
- name: 'Create MySQL wordpress database: {{ wp_db_name }}'
|
||||||
mysql_db:
|
mysql_db:
|
||||||
name: "{{ wp_db_name }}"
|
name: "{{ wp_db_name }}"
|
||||||
state: present
|
state: present
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
priv: "{{ wp_db_name }}.*:ALL,GRANT"
|
priv: "{{ wp_db_name }}.*:ALL,GRANT"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Copy wp-config.php
|
- name: Install {{ wp_abs_path }}/wp-config.php
|
||||||
template:
|
template:
|
||||||
src: wp-config.php.j2
|
src: wp-config.php.j2
|
||||||
dest: "{{ wp_abs_path }}/wp-config.php"
|
dest: "{{ wp_abs_path }}/wp-config.php"
|
||||||
|
@ -112,32 +112,32 @@
|
||||||
group: "{{ apache_user }}"
|
group: "{{ apache_user }}"
|
||||||
mode: 0660
|
mode: 0660
|
||||||
|
|
||||||
- name: Copy wordpress.conf to permit http://box{{ wp_url }}
|
- name: Install etc/{{ apache_config_dir }}/wordpress.conf from template, for http://box{{ wp_url }}
|
||||||
template:
|
template:
|
||||||
src: wordpress.conf.j2
|
src: wordpress.conf.j2
|
||||||
dest: "/etc/{{ apache_config_dir }}/wordpress.conf"
|
dest: "/etc/{{ apache_config_dir }}/wordpress.conf"
|
||||||
|
|
||||||
- name: Enable wordpress.conf if wordpress_enabled (debuntu)
|
- name: Create symlink wordpress.conf from sites-enabled to sites-available, if wordpress_enabled (debuntu)
|
||||||
file:
|
file:
|
||||||
src: /etc/apache2/sites-available/wordpress.conf
|
src: /etc/apache2/sites-available/wordpress.conf
|
||||||
dest: /etc/apache2/sites-enabled/wordpress.conf
|
path: /etc/apache2/sites-enabled/wordpress.conf
|
||||||
state: link
|
state: link
|
||||||
when: wordpress_enabled and is_debuntu
|
when: wordpress_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Remove wordpress.conf if not wordpress_enabled (debuntu)
|
- name: Remove /etc/apache2/sites-enabled/wordpress.conf if not wordpress_enabled (debuntu)
|
||||||
file:
|
file:
|
||||||
path: /etc/apache2/sites-enabled/wordpress.conf
|
path: /etc/apache2/sites-enabled/wordpress.conf
|
||||||
state: absent
|
state: absent
|
||||||
when: not wordpress_enabled and is_debuntu
|
when: not wordpress_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Restart Apache to enable/disable http://box{{ wp_url }}
|
- name: Restart Apache to enable/disable http://box{{ wp_url }}
|
||||||
service:
|
systemd:
|
||||||
name: "{{ apache_service }}"
|
name: "{{ apache_service }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: Add 'wordpress' to list of services at {{ iiab_ini_file }}
|
- name: Add 'wordpress' variable values to {{ iiab_ini_file }}
|
||||||
ini_file:
|
ini_file:
|
||||||
dest: "{{ iiab_ini_file }}"
|
path: "{{ iiab_ini_file }}"
|
||||||
section: wordpress
|
section: wordpress
|
||||||
option: "{{ item.option }}"
|
option: "{{ item.option }}"
|
||||||
value: "{{ item.value }}"
|
value: "{{ item.value }}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue