Lint the lampstack wordpress role
- Don't use shell module unless shell functionality is required Change-Id: I656e79c6d9eacbae1fa54724c3c2b06f0c2ab435
This commit is contained in:
parent
dc46a8c64d
commit
26bce3b9df
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Install wordpress
|
- name: Install wordpress
|
||||||
shell: >
|
command: >
|
||||||
wp core install --path=/var/www/html
|
wp core install --path=/var/www/html
|
||||||
--url="http://{{ hostvars.cloud.balancer.openstack.public_v4 }}"
|
--url="http://{{ hostvars.cloud.balancer.openstack.public_v4 }}"
|
||||||
--title='OpenStack Interop Challenge'
|
--title='OpenStack Interop Challenge'
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
when: hostvars.cloud.balancer.openstack.public_v4 != ""
|
when: hostvars.cloud.balancer.openstack.public_v4 != ""
|
||||||
|
|
||||||
- name: Install wordpress
|
- name: Install wordpress
|
||||||
shell: >
|
command: >
|
||||||
wp core install --path=/var/www/html
|
wp core install --path=/var/www/html
|
||||||
--url="http://{{ hostvars.cloud.balancer.openstack.private_v4 }}"
|
--url="http://{{ hostvars.cloud.balancer.openstack.private_v4 }}"
|
||||||
--title='OpenStack Interop Challenge'
|
--title='OpenStack Interop Challenge'
|
||||||
|
@ -20,60 +20,54 @@
|
||||||
when: hostvars.cloud.balancer.openstack.public_v4 == ""
|
when: hostvars.cloud.balancer.openstack.public_v4 == ""
|
||||||
|
|
||||||
- name: Activate wordpress theme
|
- name: Activate wordpress theme
|
||||||
shell: >
|
command: >
|
||||||
wp --path=/var/www/html theme activate
|
wp --path=/var/www/html theme activate
|
||||||
"{{ app_env.wp_theme.split('/').pop().split('.')[0] }}"
|
"{{ app_env.wp_theme.split('/').pop().split('.')[0] }}"
|
||||||
|
|
||||||
- name: Download wordpress importer plugin
|
- name: Download wordpress importer plugin
|
||||||
get_url:
|
get_url:
|
||||||
url: "{{ app_env.wp_importer | default('http://downloads.wordpress.org/plugin/wordpress-importer.0.6.3.zip') }}"
|
url: "{{ app_env.wp_importer | default('http://downloads.wordpress.org/plugin/wordpress-importer.0.6.3.zip') }}"
|
||||||
dest: /tmp/wordpress-importer.zip
|
dest: "/tmp/wordpress-importer.zip"
|
||||||
force: yes
|
force: "yes"
|
||||||
|
|
||||||
- name: Install wordpress importer plugin
|
- name: Install wordpress importer plugin
|
||||||
shell: >
|
command: >
|
||||||
sudo -u www-data wp --path=/var/www/html
|
sudo -u www-data wp --path=/var/www/html plugin install /tmp/wordpress-importer.zip --activate
|
||||||
plugin install /tmp/wordpress-importer.zip --activate
|
|
||||||
args:
|
args:
|
||||||
warn: no
|
warn: "no"
|
||||||
when: ansible_distribution == 'Ubuntu'
|
when: ansible_distribution == 'Ubuntu'
|
||||||
|
|
||||||
- name: Install wordpress importer plugin
|
- name: Install wordpress importer plugin
|
||||||
shell: >
|
command: >
|
||||||
sudo -u apache /usr/local/bin/wp --path=/var/www/html
|
sudo -u apache /usr/local/bin/wp --path=/var/www/html plugin install /tmp/wordpress-importer.zip
|
||||||
plugin install /tmp/wordpress-importer.zip
|
|
||||||
args:
|
args:
|
||||||
warn: no
|
warn: "no"
|
||||||
when: ansible_distribution == 'Fedora'
|
when: ansible_distribution == 'Fedora'
|
||||||
|
|
||||||
- name: Enable wordpress importer plugin
|
- name: Enable wordpress importer plugin
|
||||||
shell: >
|
command: >
|
||||||
sudo -u apache /usr/local/bin/wp --path=/var/www/html
|
sudo -u apache /usr/local/bin/wp --path=/var/www/html plugin activate wordpress-importer
|
||||||
plugin activate wordpress-importer
|
|
||||||
args:
|
args:
|
||||||
warn: no
|
warn: "no"
|
||||||
when: ansible_distribution == 'Fedora'
|
when: ansible_distribution == 'Fedora'
|
||||||
|
|
||||||
|
|
||||||
- name: Download wordpress sample posts
|
- name: Download wordpress sample posts
|
||||||
get_url:
|
get_url:
|
||||||
url: "{{ app_env.wp_posts }}"
|
url: "{{ app_env.wp_posts }}"
|
||||||
dest: /tmp/wpposts.zip
|
dest: "/tmp/wpposts.zip"
|
||||||
force: yes
|
force: "yes"
|
||||||
|
|
||||||
- name: Unpack the post
|
- name: Unpack the posts
|
||||||
shell: unzip -o -q /tmp/wpposts.zip -d /tmp/posts
|
command: unzip -o -q /tmp/wpposts.zip -d /tmp/posts
|
||||||
args:
|
args:
|
||||||
warn: no
|
warn: "no"
|
||||||
|
|
||||||
- name: Import wordpress posts
|
- name: Import wordpress posts
|
||||||
shell: >
|
command: >
|
||||||
sudo -u www-data wp --path=/var/www/html
|
sudo -u www-data wp --path=/var/www/html import /tmp/posts/*.xml --authors=create --quiet
|
||||||
import /tmp/posts/*.xml --authors=create --quiet
|
|
||||||
when: ansible_distribution == 'Ubuntu'
|
when: ansible_distribution == 'Ubuntu'
|
||||||
|
|
||||||
- name: Import wordpress posts
|
- name: Import wordpress posts
|
||||||
shell: >
|
shell: >
|
||||||
sudo -u apache /usr/local/bin/wp --path=/var/www/html
|
sudo -u apache /usr/local/bin/wp --path=/var/www/html import /tmp/posts/*.xml --authors=create --quiet
|
||||||
import /tmp/posts/*.xml --authors=create --quiet
|
|
||||||
when: ansible_distribution == 'Fedora'
|
when: ansible_distribution == 'Fedora'
|
||||||
|
|
Loading…
Reference in New Issue