Fix the following issues

1. mysql 5.6+ configuration
2. noting supporting ubuntu 16.xx
3. different platform code mixing
4. tags so that you can run selected tasks by role
5. uses openstack superuser theme and posts
6. haproxy used old configuration format

Closes-Bug #1654240
Closes-Bug #1649949

Change-Id: Ibbde92ed4fc18f85d004d54f00d3547c3df8fcc4
This commit is contained in:
Tong Li 2017-01-06 13:59:19 -05:00
parent bdaa492657
commit d09502f4f8
23 changed files with 330 additions and 231 deletions

14
workloads/ansible/shade/lampstack/README.md Normal file → Executable file
View File

@ -53,6 +53,7 @@ You may create one such file per cloud for your tests.
} }
app_env: { app_env: {
target_os: "ubuntu",
image_name: "ubuntu-15.04", image_name: "ubuntu-15.04",
region_name: "RegionOne", region_name: "RegionOne",
availability_zone: "nova", availability_zone: "nova",
@ -63,9 +64,7 @@ You may create one such file per cloud for your tests.
stack_size: 4, stack_size: 4,
volume_size: 2, volume_size: 2,
block_device_name: "/dev/vdb", block_device_name: "/dev/vdb",
config_drive: no, config_drive: no
wp_theme: "https://downloads.wordpress.org/theme/iribbon.2.0.65.zip",
wp_posts: "http://wpcandy.s3.amazonaws.com/resources/postsxml.zip"
} }
It's also possible to provide download URL's for wordpress and associated It's also possible to provide download URL's for wordpress and associated
@ -75,11 +74,10 @@ outbound network access to the Internet (defaults show below):
app_env: { app_env: {
... ...
wp_latest: 'https://wordpress.org/latest.tar.gz', wp_latest: 'https://wordpress.org/latest.tar.gz',
wp_cli: 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar',
wp_importer: 'http://downloads.wordpress.org/plugin/wordpress-importer.0.6.3.zip' wp_importer: 'http://downloads.wordpress.org/plugin/wordpress-importer.0.6.3.zip'
} }
The values of these variables should be provided by your cloud provider. When The values of the auth section should be provided by your cloud provider. When
use keystone 2.0 API, you will not need to setup domain name. You can leave use keystone 2.0 API, you will not need to setup domain name. You can leave
region_name empty if you have just one region. You can also leave region_name empty if you have just one region. You can also leave
private_net_name empty if your cloud does not support tenant network or you private_net_name empty if your cloud does not support tenant network or you
@ -88,7 +86,11 @@ have multiple tenant networks. validate_certs should be normally set to True
when your cloud uses tls(ssl) and your cloud is not using self signed when your cloud uses tls(ssl) and your cloud is not using self signed
certificate. If your cloud is using self signed certificate, then the certificate. If your cloud is using self signed certificate, then the
certificate can not be easily validated by ansible. You can skip it by setting certificate can not be easily validated by ansible. You can skip it by setting
the parameter to False. the parameter to False. currently the only values available for target_os are
ubuntu and fedora. Supported ubuntu releases are 14.04, 15.04, 15.10, 16.04
and 16.10. The wordpress theme and sample content are now provided by
OpenStack foundation. If the test is successful, the OpenStack Superuser
award site should be fully functional.
## Provision the LAMP stack ## Provision the LAMP stack

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,9 @@
#cloud-config #cloud-config
packages:
- python2.7
runcmd: runcmd:
- if [ ! -x /usr/bin/python ]; then update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10; fi
- addr=$(ip -4 -o addr | grep -v '127.0.0.1' | awk 'NR==1{print $4}' | cut -d '/' -f 1) - addr=$(ip -4 -o addr | grep -v '127.0.0.1' | awk 'NR==1{print $4}' | cut -d '/' -f 1)
- echo $addr `hostname` >> /etc/hosts - echo $addr `hostname` >> /etc/hosts

View File

@ -1,20 +1,8 @@
--- ---
- name: Haproxy install - name: Haproxy install
package: package:
name="{{ item }}" name: haproxy
state=latest state: latest
update_cache=yes
with_items:
- haproxy
when: ansible_distribution == 'Ubuntu'
- name: Haproxy install
package:
name="{{ item }}"
state=latest
with_items:
- haproxy
when: ansible_distribution == 'Fedora'
- name: Enable haproxy service - name: Enable haproxy service
replace: replace:
@ -24,21 +12,18 @@
backup: no backup: no
when: ansible_distribution == 'Ubuntu' when: ansible_distribution == 'Ubuntu'
- name: Place the haproxy configuration file - name: Modify haproxy configuration
copy: blockinfile:
src: templates/haproxy.cfg.j2
dest: /etc/haproxy/haproxy.cfg dest: /etc/haproxy/haproxy.cfg
owner: root insertafter: EOF
group: root block: |
when: ansible_distribution == 'Ubuntu' frontend http-in
bind *:80
default_backend backend_servers
option forwardfor
- name: Place the haproxy configuration file backend backend_servers
copy: balance roundrobin
src: templates/haproxy_fedora.cfg.j2
dest: /etc/haproxy/haproxy.cfg
owner: root
group: root
when: ansible_distribution == 'Fedora'
- name: Add web servers to the haproxy - name: Add web servers to the haproxy
lineinfile: lineinfile:

View File

@ -1,33 +0,0 @@
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
option redispatch
retries 3
contimeout 5000
clitimeout 50000
srvtimeout 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
listen webfarm 0.0.0.0:80
mode http
stats enable
stats uri /haproxy?stats
balance roundrobin
option httpclose
option forwardfor

View File

@ -1,34 +0,0 @@
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
option redispatch
retries 3
contimeout 5000
clitimeout 50000
srvtimeout 50000
errorfile 400 /usr/share/haproxy/400.http
errorfile 403 /usr/share/haproxy/403.http
errorfile 408 /usr/share/haproxy/408.http
errorfile 500 /usr/share/haproxy/500.http
errorfile 502 /usr/share/haproxy/502.http
errorfile 503 /usr/share/haproxy/503.http
errorfile 504 /usr/share/haproxy/504.http
listen webfarm
bind 0.0.0.0:80
mode http
stats enable
stats uri /haproxy?stats
balance roundrobin
option httpclose
option forwardfor

View File

@ -3,17 +3,10 @@
local_action: wait_for port=22 host="{{ ansible_ssh_host | default(inventory_hostname) }}" search_regex=OpenSSH delay=10 local_action: wait_for port=22 host="{{ ansible_ssh_host | default(inventory_hostname) }}" search_regex=OpenSSH delay=10
become: no become: no
- name: Check if running on Fedora
raw: "[ -f /etc/fedora-release ]"
register: fedora_release
ignore_errors: yes
- name: Install python2 for Ansible - name: Install python2 for Ansible
raw: dnf install -y python2 python2-dnf libselinux-python raw: dnf install -y python2 python2-dnf libselinux-python
register: result register: result
until: result|success until: result|success
when: fedora_release.rc == 0
- name: Set SELinux to permisive - name: Set SELinux to permisive
selinux: policy=targeted state=permissive selinux: policy=targeted state=permissive
when: fedora_release.rc == 0

View File

@ -0,0 +1,4 @@
---
- name: Wait until server is up and runnning
local_action: wait_for port=22 host="{{ ansible_ssh_host | default(inventory_hostname) }}" search_regex=OpenSSH delay=10
become: no

View File

@ -104,6 +104,12 @@
- python2-mysql - python2-mysql
when: ansible_distribution == 'Fedora' when: ansible_distribution == 'Fedora'
- name: Update MySQL root password for all root accounts
mysql_user: name=root host={{ item }} password={{ db_pass }} state=present
with_items:
- 127.0.0.1
- localhost
- service: name=mysql state=stopped enabled=yes - service: name=mysql state=stopped enabled=yes
when: ansible_distribution == 'Ubuntu' when: ansible_distribution == 'Ubuntu'
@ -125,10 +131,11 @@
register: mysqlflag register: mysqlflag
- name: Configure mysql 5.6+ - name: Configure mysql 5.6+
replace: ini_file:
dest: "/etc/mysql/mysql.conf.d/mysqld.cnf" dest=/etc/mysql/mysql.conf.d/mysqld.cnf
replace: "bind-address = {{ local_ip.stdout }}" section=mysqld
backup: no option=bind-address
value={{ local_ip.stdout }}
when: mysqlflag.stat.exists == true when: mysqlflag.stat.exists == true
- stat: path=/etc/my.cnf - stat: path=/etc/my.cnf
@ -152,13 +159,17 @@
mysql_db: mysql_db:
name: "decision2016" name: "decision2016"
state: "{{ item }}" state: "{{ item }}"
login_user: root
login_password: "{{ db_pass }}"
with_items: with_items:
- ['present', 'absent', 'present'] - ['absent', 'present']
- name: Add a user - name: Add a user
mysql_user: mysql_user:
name: "{{ db_user }}" name: "{{ db_user }}"
password: "{{ db_pass }}" password: "{{ db_pass }}"
login_user: root
login_password: "{{ db_pass }}"
host: "%" host: "%"
priv: 'decision2016.*:ALL' priv: 'decision2016.*:ALL'
state: present state: present

View File

@ -8,10 +8,29 @@
- apache2 - apache2
- php5 - php5
- php5-mysql - php5-mysql
- php5-gd
- nfs-common - nfs-common
- unzip - unzip
- ssmtp - ssmtp
when: ansible_distribution == 'Ubuntu' when: ansible_distribution == 'Ubuntu' and ansible_distribution_version < '16.04'
- name: Apache and php 7
package:
name="{{ item }}"
state=latest
update_cache=yes
with_items:
- apache2
- php7.0
- php7.0-mysql
- libapache2-mod-php7.0
- php7.0-cli
- php7.0-cgi
- php7.0-gd
- nfs-common
- unzip
- ssmtp
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '16.04'
- name: Apache and php 5 - name: Apache and php 5
package: package:
@ -21,6 +40,7 @@
- httpd - httpd
- php - php
- php-mysqlnd - php-mysqlnd
- php5-gd
- nfs-utils - nfs-utils
- unzip - unzip
- ssmtp - ssmtp
@ -30,9 +50,29 @@
args: args:
warn: no warn: no
- name: Enable mod_rewrite
apache2_module: name=rewrite state=present
- name: Enable htaccess
blockinfile:
dest: /etc/apache2/sites-enabled/000-default.conf
insertafter: "DocumentRoot /var/www/html"
content: |
<Directory /var/www/html>
AllowOverride All
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
</Directory>
- name: Creates share directory for wpcontent - name: Creates share directory for wpcontent
file: file:
path: /var/www/html/wp-content/uploads path: /var/www/html/wp-content
state: directory state: directory
owner: www-data owner: www-data
group: www-data group: www-data
@ -40,7 +80,7 @@
- name: Creates share directory for wpcontent - name: Creates share directory for wpcontent
file: file:
path: /var/www/html/wp-content/uploads path: /var/www/html/wp-content
state: directory state: directory
owner: apache owner: apache
group: apache group: apache
@ -48,7 +88,7 @@
- name: Mount the directory using private IP - name: Mount the directory using private IP
mount: mount:
name: /var/www/html/wp-content/uploads name: /var/www/html/wp-content
src: "{{ hostvars.cloud.database.openstack.private_v4 }}:/storage/wpcontent" src: "{{ hostvars.cloud.database.openstack.private_v4 }}:/storage/wpcontent"
state: mounted state: mounted
fstype: nfs fstype: nfs
@ -56,7 +96,7 @@
- name: Mount the directory using public IP - name: Mount the directory using public IP
mount: mount:
name: /var/www/html/wp-content/uploads name: /var/www/html/wp-content
src: "{{ hostvars.cloud.database.openstack.public_v4 }}:/storage/wpcontent" src: "{{ hostvars.cloud.database.openstack.public_v4 }}:/storage/wpcontent"
state: mounted state: mounted
fstype: nfs fstype: nfs
@ -70,8 +110,9 @@
- name: Download wordpress - name: Download wordpress
get_url: get_url:
url: "{{ app_env.wp_latest | default('https://wordpress.org/latest.tar.gz') }}" url: "{{ app_env.wp_latest | default('https://wordpress.org/wordpress-4.6.1.tar.gz') }}"
dest: /var/www/latest.tar.gz dest: /var/www/latest.tar.gz
force: no
- name: Unpack latest wordpress - name: Unpack latest wordpress
shell: tar -xf /var/www/latest.tar.gz -C /var/www/html --strip-components=1 shell: tar -xf /var/www/latest.tar.gz -C /var/www/html --strip-components=1
@ -129,19 +170,8 @@
when: ansible_distribution == 'Fedora' when: ansible_distribution == 'Fedora'
- name: Install wordpress command line tool - name: Install wordpress command line tool
get_url: copy:
url: "{{ app_env.wp_cli | default('https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar') }}" src: files/wp-cli.phar
dest: /usr/local/bin/wp dest: /usr/local/bin/wp
mode: "a+x" mode: "a+x"
force: no force: no
- name: Download a wordpress theme
get_url:
url: "{{ app_env.wp_theme }}"
dest: /tmp/wptheme.zip
force: yes
- name: Install the theme
shell: unzip -o -q /tmp/wptheme.zip -d /var/www/html/wp-content/themes
args:
warn: no

View File

@ -0,0 +1,100 @@
---
- name: Download a wordpress theme
copy:
src: files/wptheme.zip
dest: /tmp/wptheme.zip
force: no
- name: Install the theme
shell: sudo -u apache unzip -o -q /tmp/wptheme.zip -d /var/www/html/wp-content/themes
args:
warn: no
- name: Install wordpress
command: >
wp core install --path=/var/www/html
--url="http://{{ hostvars.cloud.balancer.openstack.public_v4 }}"
--title='OpenStack Interop Challenge'
--admin_user=wpuser
--admin_password="{{ db_pass }}"
--admin_email='interop@openstack.org'
when: hostvars.cloud.balancer.openstack.public_v4 != ""
- name: Install wordpress
command: >
wp core install --path=/var/www/html
--url="http://{{ hostvars.cloud.balancer.openstack.private_v4 }}"
--title='OpenStack Interop Challenge'
--admin_user=wpuser
--admin_password="{{ db_pass }}"
--admin_email='interop@openstack.org'
when: hostvars.cloud.balancer.openstack.public_v4 == ""
- name: Install package for automated plugin activation
shell: >
wp package install itspriddle/wp-cli-tgmpa-plugin
- name: Make an initial request, so that later switch-theme hooks work.
shell: >
sudo -u apache wp --path=/var/www/html
cron test
- name: Activate wordpress theme
command: >
wp --path=/var/www/html theme activate superuser
- name: Install and activate required plugins
shell: >
sudo -u apache wp --path=/var/www/html
tgmpa-plugin install --all-required --activate
args:
warn: no
- name: Download wordpress importer plugin
get_url:
url: "{{ app_env.wp_importer | default('http://downloads.wordpress.org/plugin/wordpress-importer.0.6.3.zip') }}"
dest: "/tmp/wordpress-importer.zip"
force: "yes"
- name: Install wordpress importer plugin
command: >
sudo -u apache wp --path=/var/www/html plugin install /tmp/wordpress-importer.zip --activate
args:
warn: "no"
- name: Create temporary post directory
file:
path: /tmp/posts
state: directory
mode: "u=rwx,g=rwx,o=rx"
- name: Unpack the posts
unarchive:
src: files/wpposts.zip
dest: /tmp/posts
remote_src: no
- name: Wait for the posts to be unpacked
wait_for:
path: /tmp/posts
state: present
- name: Import wordpress posts
command: >
wp --path=/var/www/html import /tmp/posts/superuser_content.xml --authors=create --quiet
- name: Regenerate thumbnails for the imported posts
shell: >
sudo -u apache wp --path=/var/www/html media regenerate --yes --quiet
- name: Trigger post-activation hooks
shell: >
sudo -u apache wp --path=/var/www/html
cron test
- name: Flush rewrite rules, setup htaccess for nice permalinks
shell: >
sudo -u apache
WP_CLI_CONFIG_PATH=/var/www/html/wp-content/themes/superuser/wp-cli.yml
wp --path=/var/www/html
rewrite flush --hard

View File

@ -1,73 +0,0 @@
---
- name: Install wordpress
command: >
wp core install --path=/var/www/html
--url="http://{{ hostvars.cloud.balancer.openstack.public_v4 }}"
--title='OpenStack Interop Challenge'
--admin_user=wpuser
--admin_password="{{ db_pass }}"
--admin_email='interop@openstack.org'
when: hostvars.cloud.balancer.openstack.public_v4 != ""
- name: Install wordpress
command: >
wp core install --path=/var/www/html
--url="http://{{ hostvars.cloud.balancer.openstack.private_v4 }}"
--title='OpenStack Interop Challenge'
--admin_user=wpuser
--admin_password="{{ db_pass }}"
--admin_email='interop@openstack.org'
when: hostvars.cloud.balancer.openstack.public_v4 == ""
- name: Activate wordpress theme
command: >
wp --path=/var/www/html theme activate
"{{ app_env.wp_theme.split('/').pop().split('.')[0] }}"
- name: Download wordpress importer plugin
get_url:
url: "{{ app_env.wp_importer | default('http://downloads.wordpress.org/plugin/wordpress-importer.0.6.3.zip') }}"
dest: "/tmp/wordpress-importer.zip"
force: "yes"
- name: Install wordpress importer plugin
command: >
sudo -u www-data wp --path=/var/www/html plugin install /tmp/wordpress-importer.zip --activate
args:
warn: "no"
when: ansible_distribution == 'Ubuntu'
- name: Install wordpress importer plugin
command: >
sudo -u apache /usr/local/bin/wp --path=/var/www/html plugin install /tmp/wordpress-importer.zip
args:
warn: "no"
when: ansible_distribution == 'Fedora'
- name: Enable wordpress importer plugin
command: >
sudo -u apache /usr/local/bin/wp --path=/var/www/html plugin activate wordpress-importer
args:
warn: "no"
when: ansible_distribution == 'Fedora'
- name: Download wordpress sample posts
get_url:
url: "{{ app_env.wp_posts }}"
dest: "/tmp/wpposts.zip"
force: "yes"
- name: Unpack the posts
command: unzip -o -q /tmp/wpposts.zip -d /tmp/posts
args:
warn: "no"
- name: Import wordpress posts
command: >
sudo -u www-data wp --path=/var/www/html import /tmp/posts/*.xml --authors=create --quiet
when: ansible_distribution == 'Ubuntu'
- name: Import wordpress posts
shell: >
sudo -u apache /usr/local/bin/wp --path=/var/www/html import /tmp/posts/*.xml --authors=create --quiet
when: ansible_distribution == 'Fedora'

View File

@ -0,0 +1,100 @@
---
- name: Download a wordpress theme
copy:
src: files/wptheme.zip
dest: /tmp/wptheme.zip
force: no
- name: Install the theme
shell: sudo -u www-data unzip -o -q /tmp/wptheme.zip -d /var/www/html/wp-content/themes
args:
warn: no
- name: Install wordpress
command: >
wp core install --path=/var/www/html
--url="http://{{ hostvars.cloud.balancer.openstack.public_v4 }}"
--title='OpenStack Interop Challenge'
--admin_user=wpuser
--admin_password="{{ db_pass }}"
--admin_email='interop@openstack.org'
when: hostvars.cloud.balancer.openstack.public_v4 != ""
- name: Install wordpress
command: >
wp core install --path=/var/www/html
--url="http://{{ hostvars.cloud.balancer.openstack.private_v4 }}"
--title='OpenStack Interop Challenge'
--admin_user=wpuser
--admin_password="{{ db_pass }}"
--admin_email='interop@openstack.org'
when: hostvars.cloud.balancer.openstack.public_v4 == ""
- name: Install package for automated plugin activation
shell: >
wp package install itspriddle/wp-cli-tgmpa-plugin
- name: Make an initial request, so that later switch-theme hooks work.
shell: >
sudo -u www-data wp --path=/var/www/html
cron test
- name: Activate wordpress theme
command: >
wp --path=/var/www/html theme activate superuser
- name: Install and activate required plugins
shell: >
sudo -u www-data wp --path=/var/www/html
tgmpa-plugin install --all-required --activate
args:
warn: no
- name: Download wordpress importer plugin
get_url:
url: "{{ app_env.wp_importer | default('http://downloads.wordpress.org/plugin/wordpress-importer.0.6.3.zip') }}"
dest: "/tmp/wordpress-importer.zip"
force: "yes"
- name: Install wordpress importer plugin
command: >
sudo -u www-data wp --path=/var/www/html plugin install /tmp/wordpress-importer.zip --activate
args:
warn: "no"
- name: Create temporary post directory
file:
path: /tmp/posts
state: directory
mode: "u=rwx,g=rwx,o=rx"
- name: Unpack the posts
unarchive:
src: files/wpposts.zip
dest: /tmp/posts
remote_src: no
- name: Wait for the posts to be unpacked
wait_for:
path: /tmp/posts
state: present
- name: Import wordpress posts
command: >
wp --path=/var/www/html import /tmp/posts/superuser_content.xml --authors=create --quiet
- name: Regenerate thumbnails for the imported posts
shell: >
sudo -u www-data wp --path=/var/www/html media regenerate --yes --quiet
- name: Trigger post-activation hooks
shell: >
sudo -u www-data wp --path=/var/www/html
cron test
- name: Flush rewrite rules, setup htaccess for nice permalinks
shell: >
sudo -u www-data
WP_CLI_CONFIG_PATH=/var/www/html/wp-content/themes/superuser/wp-cli.yml
wp --path=/var/www/html
rewrite flush --hard

View File

@ -6,18 +6,22 @@
- "vars/{{ env }}.yml" - "vars/{{ env }}.yml"
roles: roles:
- "{{ action }}" - "{{ action }}"
tags: "{{ action }}"
- name: Install python2 for ansible to work - name: Install python2 for ansible to work
hosts: dbservers, webservers, balancers, wps hosts: dbservers, webservers, balancers
gather_facts: false gather_facts: false
user: "{{ app_env.ssh_user }}" user: "{{ app_env.ssh_user }}"
become: true become: true
become_user: root become_user: root
vars_files: vars_files:
- "vars/{{ env }}.yml" - "vars/{{ env }}.yml"
tasks:
- include: "roles/common/tasks/{{ app_env.target_os }}.yml"
roles: roles:
- common - common
environment: "{{ proxy_env }}" environment: "{{ proxy_env }}"
tags: "common"
- name: setup database - name: setup database
hosts: dbservers hosts: dbservers
@ -29,9 +33,11 @@
roles: roles:
- database - database
environment: "{{proxy_env}}" environment: "{{proxy_env}}"
tags: "database"
- name: setup web servers - name: setup web servers
hosts: webservers hosts: webservers
gather_facts: true
user: "{{ app_env.ssh_user }}" user: "{{ app_env.ssh_user }}"
become: true become: true
become_user: root become_user: root
@ -40,6 +46,7 @@
roles: roles:
- webserver - webserver
environment: "{{proxy_env}}" environment: "{{proxy_env}}"
tags: "webserver"
- name: setup load balancer servers - name: setup load balancer servers
hosts: balancers hosts: balancers
@ -51,15 +58,19 @@
roles: roles:
- balancer - balancer
environment: "{{proxy_env}}" environment: "{{proxy_env}}"
tags: "balancer"
- name: install wordpress - name: install wordpress
hosts: wps hosts: wps
user: "{{ app_env.ssh_user }}" user: "{{ app_env.ssh_user }}"
vars_files: vars_files:
- "vars/{{ env }}.yml" - "vars/{{ env }}.yml"
tasks:
- include: "roles/wordpress/tasks/{{ app_env.target_os }}.yml"
roles: roles:
- wordpress - wordpress
environment: "{{proxy_env}}" environment: "{{proxy_env}}"
tags: "wordpress"
- name: clean up resources - name: clean up resources
hosts: cloud hosts: cloud
@ -71,6 +82,7 @@
roles: roles:
- cleaner - cleaner
environment: "{{proxy_env}}" environment: "{{proxy_env}}"
tags: "cleaner"
- name: Inform the installer - name: Inform the installer
hosts: cloud hosts: cloud
@ -94,3 +106,4 @@
msg: >- msg: >-
The work load test started at {{ hostvars.cloud.starttime.time }}, The work load test started at {{ hostvars.cloud.starttime.time }},
ended at {{ ansible_date_time.time }} ended at {{ ansible_date_time.time }}
tags: "info"

7
workloads/ansible/shade/lampstack/vars/bluebox.yml Normal file → Executable file
View File

@ -9,8 +9,9 @@ auth: {
} }
app_env: { app_env: {
target_os: "ubuntu",
ssh_user: "ubuntu", ssh_user: "ubuntu",
image_name: "ubuntu-15.04", image_name: "ubuntu-16.10",
region_name: "", region_name: "",
availability_zone: "", availability_zone: "",
validate_certs: True, validate_certs: True,
@ -20,6 +21,6 @@ app_env: {
stack_size: 4, stack_size: 4,
volume_size: 10, volume_size: 10,
block_device_name: "/dev/vdb", block_device_name: "/dev/vdb",
wp_theme: "https://downloads.wordpress.org/theme/iribbon.2.0.65.zip", wp_latest: "https://wordpress.org/wordpress-4.6.1.tar.gz",
wp_posts: "http://wpcandy.s3.amazonaws.com/resources/postsxml.zip" wp_importer: "http://downloads.wordpress.org/plugin/wordpress-importer.0.6.3.zip"
} }

5
workloads/ansible/shade/lampstack/vars/dreamhost.yml Normal file → Executable file
View File

@ -9,6 +9,7 @@ auth: {
} }
app_env: { app_env: {
target_os: "ubuntu",
ssh_user: "ubuntu", ssh_user: "ubuntu",
region_name: "RegionOne", region_name: "RegionOne",
image_name: "Ubuntu-14.04", image_name: "Ubuntu-14.04",
@ -19,7 +20,5 @@ app_env: {
public_key_file: "/home/reed/.ssh/id_rsa.pub", public_key_file: "/home/reed/.ssh/id_rsa.pub",
stack_size: 4, stack_size: 4,
volume_size: 10, volume_size: 10,
block_device_name: "/dev/vdb", block_device_name: "/dev/vdb"
wp_theme: "https://downloads.wordpress.org/theme/iribbon.2.0.65.zip",
wp_posts: "http://wpcandy.s3.amazonaws.com/resources/postsxml.zip"
} }

12
workloads/ansible/shade/lampstack/vars/leap.yml Normal file → Executable file
View File

@ -10,17 +10,17 @@ auth: {
} }
app_env: { app_env: {
image_name: "ubuntu-15.04", target_os: "ubuntu",
image_name: "ubuntu-14.04",
region_name: "RegionOne", region_name: "RegionOne",
availability_zone: "nova", availability_zone: "nova",
validate_certs: False, validate_certs: False,
ssh_user: "ubuntu", ssh_user: "ubuntu",
private_net_name: "Bluebox", private_net_name: "demonet",
flavor_name: "m1.small", flavor_name: "m1.large",
public_key_file: "/home/tong/.ssh/id_rsa.pub", public_key_file: "/home/ubuntu/.ssh/id_rsa.pub",
stack_size: 4, stack_size: 4,
volume_size: 2, volume_size: 2,
block_device_name: "/dev/vdb", block_device_name: "/dev/vdb",
wp_theme: "https://downloads.wordpress.org/theme/iribbon.2.0.65.zip", wp_latest: "https://wordpress.org/wordpress-4.6.tar.gz"
wp_posts: "http://wpcandy.s3.amazonaws.com/resources/postsxml.zip"
} }

5
workloads/ansible/shade/lampstack/vars/osic.yml Normal file → Executable file
View File

@ -10,6 +10,7 @@ auth: {
} }
app_env: { app_env: {
target_os: "ubuntu",
image_name: "ubuntu-server-14.04", image_name: "ubuntu-server-14.04",
region_name: "", region_name: "",
availability_zone: "nova", availability_zone: "nova",
@ -19,7 +20,5 @@ app_env: {
public_key_file: "/home/tong/.ssh/id_rsa.pub", public_key_file: "/home/tong/.ssh/id_rsa.pub",
stack_size: 4, stack_size: 4,
volume_size: 2, volume_size: 2,
block_device_name: "/dev/vdb", block_device_name: "/dev/vdb"
wp_theme: "https://downloads.wordpress.org/theme/iribbon.2.0.65.zip",
wp_posts: "http://wpcandy.s3.amazonaws.com/resources/postsxml.zip"
} }

5
workloads/ansible/shade/lampstack/vars/otc.yml Normal file → Executable file
View File

@ -8,6 +8,7 @@ auth: {
} }
app_env: { app_env: {
target_os: "ubuntu",
image_name: "Community_Ubuntu_14.04_TSI_20161004_0", image_name: "Community_Ubuntu_14.04_TSI_20161004_0",
region_name: "", region_name: "",
availability_zone: "eu-de-01", availability_zone: "eu-de-01",
@ -18,7 +19,5 @@ app_env: {
ssh_user: "ubuntu", ssh_user: "ubuntu",
stack_size: 4, stack_size: 4,
volume_size: 2, volume_size: 2,
block_device_name: "/dev/xvdb", block_device_name: "/dev/xvdb"
wp_theme: "https://downloads.wordpress.org/theme/iribbon.2.0.65.zip",
wp_posts: "http://wpcandy.s3.amazonaws.com/resources/postsxml.zip"
} }

5
workloads/ansible/shade/lampstack/vars/ovh.yml Normal file → Executable file
View File

@ -9,6 +9,7 @@ auth: {
} }
app_env: { app_env: {
target_os: "ubuntu",
ssh_user: "ubuntu", ssh_user: "ubuntu",
region_name: "SBG1", region_name: "SBG1",
image_name: "Ubuntu 14.04", image_name: "Ubuntu 14.04",
@ -19,7 +20,5 @@ app_env: {
public_key_file: "/home/ubuntu/.ssh/id_rsa.pub", public_key_file: "/home/ubuntu/.ssh/id_rsa.pub",
stack_size: 4, stack_size: 4,
volume_size: 4, volume_size: 4,
block_device_name: "/dev/vdb", block_device_name: "/dev/vdb"
wp_theme: "https://downloads.wordpress.org/theme/iribbon.2.0.65.zip",
wp_posts: "http://wpcandy.s3.amazonaws.com/resources/postsxml.zip"
} }

5
workloads/ansible/shade/lampstack/vars/trystack.yml Normal file → Executable file
View File

@ -25,6 +25,7 @@ auth: {
} }
app_env: { app_env: {
target_os: "ubuntu",
ssh_user: "ubuntu", ssh_user: "ubuntu",
image_name: "ubuntu1404", image_name: "ubuntu1404",
region_name: "regionOne", region_name: "regionOne",
@ -35,7 +36,5 @@ app_env: {
public_key_file: "/root/.ssh/id_rsa.pub", public_key_file: "/root/.ssh/id_rsa.pub",
stack_size: 4, stack_size: 4,
volume_size: 2, volume_size: 2,
block_device_name: "/dev/vdb", block_device_name: "/dev/vdb"
wp_theme: "https://downloads.wordpress.org/theme/iribbon.2.0.65.zip",
wp_posts: "http://wpcandy.s3.amazonaws.com/resources/postsxml.zip"
} }