Skip to content

Commit 40ac38f

Browse files
committed
Minor-commit
1 parent 9074038 commit 40ac38f

File tree

37 files changed

+1291
-0
lines changed

37 files changed

+1291
-0
lines changed

demo-role/wordpress-demo/playbook.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
- host: db_hosts
3+
roles:
4+
- mysql
5+
- hosts: web_hosts
6+
roles:
7+
- server
8+
- php
9+
- wordpress
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
language: python
3+
python: "2.7"
4+
5+
# Use the new container infrastructure
6+
sudo: false
7+
8+
# Install ansible
9+
addons:
10+
apt:
11+
packages:
12+
- python-pip
13+
14+
install:
15+
# Install ansible
16+
- pip install ansible
17+
18+
# Check ansible version
19+
- ansible --version
20+
21+
# Create ansible.cfg with correct roles_path
22+
- printf '[defaults]\nroles_path=../' >ansible.cfg
23+
24+
script:
25+
# Basic role syntax check
26+
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
27+
28+
notifications:
29+
webhooks: https://galaxy.ansible.com/api/v1/notifications/
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Role Name
2+
=========
3+
4+
A brief description of the role goes here.
5+
6+
Requirements
7+
------------
8+
9+
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
10+
11+
Role Variables
12+
--------------
13+
14+
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
15+
16+
Dependencies
17+
------------
18+
19+
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
20+
21+
Example Playbook
22+
----------------
23+
24+
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
25+
26+
- hosts: servers
27+
roles:
28+
- { role: username.rolename, x: 42 }
29+
30+
License
31+
-------
32+
33+
BSD
34+
35+
Author Information
36+
------------------
37+
38+
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
# defaults file for mysql
3+
---
4+
wp_mysql_db: wordpress
5+
wp_mysql_user: wordpress
6+
wp_mysql_password: TetraCloud123$
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
# handlers file for mysql
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
galaxy_info:
2+
author: your name
3+
description: your description
4+
company: your company (optional)
5+
6+
# If the issue tracker for your role is not on github, uncomment the
7+
# next line and provide a value
8+
# issue_tracker_url: http://example.com/issue/tracker
9+
10+
# Some suggested licenses:
11+
# - BSD (default)
12+
# - MIT
13+
# - GPLv2
14+
# - GPLv3
15+
# - Apache
16+
# - CC-BY
17+
license: license (GPLv2, CC-BY, etc)
18+
19+
min_ansible_version: 1.2
20+
21+
# Optionally specify the branch Galaxy will use when accessing the GitHub
22+
# repo for this role. During role install, if no tags are available,
23+
# Galaxy will use this branch. During import Galaxy will access files on
24+
# this branch. If travis integration is cofigured, only notification for this
25+
# branch will be accepted. Otherwise, in all cases, the repo's default branch
26+
# (usually master) will be used.
27+
#github_branch:
28+
29+
#
30+
# Below are all platforms currently available. Just uncomment
31+
# the ones that apply to your role. If you don't see your
32+
# platform on this list, let us know and we'll get it added!
33+
#
34+
#platforms:
35+
#- name: OpenBSD
36+
# versions:
37+
# - all
38+
# - 5.6
39+
# - 5.7
40+
# - 5.8
41+
# - 5.9
42+
# - 6.0
43+
#- name: Fedora
44+
# versions:
45+
# - all
46+
# - 16
47+
# - 17
48+
# - 18
49+
# - 19
50+
# - 20
51+
# - 21
52+
# - 22
53+
# - 23
54+
# - 24
55+
# - 25
56+
#- name: DellOS
57+
# versions:
58+
# - all
59+
# - 10
60+
# - 6
61+
# - 9
62+
#- name: MacOSX
63+
# versions:
64+
# - all
65+
# - 10.10
66+
# - 10.11
67+
# - 10.12
68+
# - 10.7
69+
# - 10.8
70+
# - 10.9
71+
#- name: Synology
72+
# versions:
73+
# - all
74+
# - any
75+
#- name: Junos
76+
# versions:
77+
# - all
78+
# - any
79+
#- name: GenericBSD
80+
# versions:
81+
# - all
82+
# - any
83+
#- name: Void Linux
84+
# versions:
85+
# - all
86+
# - any
87+
#- name: GenericLinux
88+
# versions:
89+
# - all
90+
# - any
91+
#- name: NXOS
92+
# versions:
93+
# - all
94+
# - any
95+
#- name: IOS
96+
# versions:
97+
# - all
98+
# - any
99+
#- name: Amazon
100+
# versions:
101+
# - all
102+
# - 2013.03
103+
# - 2013.09
104+
# - 2016.03
105+
#- name: ArchLinux
106+
# versions:
107+
# - all
108+
# - any
109+
#- name: FreeBSD
110+
# versions:
111+
# - all
112+
# - 10.0
113+
# - 10.1
114+
# - 10.2
115+
# - 10.3
116+
# - 11.0
117+
# - 8.0
118+
# - 8.1
119+
# - 8.2
120+
# - 8.3
121+
# - 8.4
122+
# - 9.0
123+
# - 9.1
124+
# - 9.1
125+
# - 9.2
126+
# - 9.3
127+
#- name: Ubuntu
128+
# versions:
129+
# - all
130+
# - lucid
131+
# - maverick
132+
# - natty
133+
# - oneiric
134+
# - precise
135+
# - quantal
136+
# - raring
137+
# - saucy
138+
# - trusty
139+
# - utopic
140+
# - vivid
141+
# - wily
142+
# - xenial
143+
# - yakkety
144+
#- name: Debian
145+
# versions:
146+
# - all
147+
# - etch
148+
# - jessie
149+
# - lenny
150+
# - sid
151+
# - squeeze
152+
# - stretch
153+
# - wheezy
154+
#- name: Alpine
155+
# versions:
156+
# - all
157+
# - any
158+
#- name: EL
159+
# versions:
160+
# - all
161+
# - 5
162+
# - 6
163+
# - 7
164+
#- name: Windows
165+
# versions:
166+
# - all
167+
# - 2012R2
168+
#- name: SmartOS
169+
# versions:
170+
# - all
171+
# - any
172+
#- name: opensuse
173+
# versions:
174+
# - all
175+
# - 12.1
176+
# - 12.2
177+
# - 12.3
178+
# - 13.1
179+
# - 13.2
180+
#- name: SLES
181+
# versions:
182+
# - all
183+
# - 10SP3
184+
# - 10SP4
185+
# - 11
186+
# - 11SP1
187+
# - 11SP2
188+
# - 11SP3
189+
# - 11SP4
190+
# - 12
191+
# - 12SP1
192+
#- name: GenericUNIX
193+
# versions:
194+
# - all
195+
# - any
196+
#- name: Solaris
197+
# versions:
198+
# - all
199+
# - 10
200+
# - 11.0
201+
# - 11.1
202+
# - 11.2
203+
# - 11.3
204+
#- name: eos
205+
# versions:
206+
# - all
207+
# - Any
208+
209+
galaxy_tags: []
210+
# List tags for your role here, one per line. A tag is
211+
# a keyword that describes and categorizes the role.
212+
# Users find roles by searching for tags. Be sure to
213+
# remove the '[]' above if you add tags to this list.
214+
#
215+
# NOTE: A tag is limited to a single word comprised of
216+
# alphanumeric characters. Maximum 20 tags per role.
217+
218+
dependencies: []
219+
# List your role dependencies here, one per line.
220+
# Be sure to remove the '[]' above if you add dependencies
221+
# to this list.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
# tasks file for mysql
3+
---
4+
- name: Create mysql database
5+
mysql_db: name={{ wp_mysql_db }} state=present
6+
7+
- name: Create mysql user
8+
mysql_user:
9+
name={{ wp_mysql_user }}
10+
password={{ wp_mysql_password }}
11+
priv=*.*:ALL
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
localhost
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- hosts: localhost
3+
remote_user: root
4+
roles:
5+
- mysql
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
# vars file for mysql
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
language: python
3+
python: "2.7"
4+
5+
# Use the new container infrastructure
6+
sudo: false
7+
8+
# Install ansible
9+
addons:
10+
apt:
11+
packages:
12+
- python-pip
13+
14+
install:
15+
# Install ansible
16+
- pip install ansible
17+
18+
# Check ansible version
19+
- ansible --version
20+
21+
# Create ansible.cfg with correct roles_path
22+
- printf '[defaults]\nroles_path=../' >ansible.cfg
23+
24+
script:
25+
# Basic role syntax check
26+
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
27+
28+
notifications:
29+
webhooks: https://galaxy.ansible.com/api/v1/notifications/

0 commit comments

Comments
 (0)