-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrax-magento.yml
54 lines (49 loc) · 1.59 KB
/
rax-magento.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Ansible playbook to create a Rackspace Cloud Server and install Magento.
# After server is created it will use rax_adminpass and install packages.
# Change file rax.py with your username and api_key for auth.
# Run with: ansible-playbook -i hosts.yml rax-magento.yml -vvv
# For image and flavor list check file lists.txt
# Created by Eric Cavalcanti - [email protected]
---
- name: Build environment
hosts: localhost
connection: local
gather_facts: False
tasks:
- name: Server create request
local_action:
module: rax
credentials: rax.py
name: magento
flavor: performance1-1
image: 41e59c5f-530b-423c-86ec-13b23de49288
disk_config: manual
networks:
- public
- private
region: ORD
state: present
wait: yes
register: rax
- name: Add servers to web host group
local_action:
module: add_host
hostname: "{{ item.name }}"
ansible_ssh_host: "{{ item.rax_accessipv4 }}"
ansible_ssh_pass: "{{ item.rax_adminpass }}"
ansible_ssh_user: root
groupname: web
with_items: rax.instances
when: rax.action == 'create'
- name: Wait few seconds before connection
wait_for: port=22 delay=20
- name: Install magento, MySQL, httpd, PHP and Varnish
hosts: web
roles:
- common
- { role: mysql, when: db_choice == 'mysql' }
- { role: percona, when: db_choice == 'percona' }
- httpd
- php
- { role: varnish, when: varnish_install == 'install' }
- { role: magento, when: magento_install == 'install' }