Skip to content
Snippets Groups Projects
Commit 5c0d3697 authored by nimrod's avatar nimrod
Browse files

- Forked from ansible-role-example.

parent 1f52f9ae
No related branches found
No related tags found
No related merge requests found
Example
mod-php
#######
An (empty) example Ansible role complete with working tests out of the box. For
more information read the `blog post
<https://www.shore.co.il/blog/ansible-example-role/>`_.
Provision PHP application server using Apache with mod-php.
Requirements
------------
......
---
# defaults file for ansible-role-example
# defaults file for ansible-role-mod-php
---
# handlers file for ansible-role-example
# handlers file for ansible-role-mod-php
galaxy_info:
author: Nimrod Adar
description: An example Ansible role
description: Provision PHP application server using Apache with mod-php
company: Shore technologies
license: MIT
min_ansible_version: 2.0
platforms:
- name: OpenBSD
- name: Debian
versions:
- 6.0
- name: Ubuntu
versions:
- xenial
galaxy_tags: [ ansible ]
dependencies: []
- jessie
galaxy_tags: [ PHP ]
dependencies:
- src: https://www.shore.co.il/git/ansible-role-php5
scm: git
name: PHP5
- src: https://www.shore.co.il/git/ansible-role-apache
scm: git
name: Apache
......@@ -4,19 +4,16 @@ ansible:
playbook: tests/playbook.yml
diff: True
config_file: ../ansible.cfg
requirements_file: tests/requirements.yml
vagrant:
providers:
- name: virtualbox
type: virtualbox
platforms:
- name: openbsd
box: kaorimatz/openbsd-6.0-amd64
- name: ubuntu
box: ubuntu/xenial64
- name: debian
box: debian/jessie64
instances:
- name: ansible-role-example
- name: ansible-role-mod-php
options:
append_platform_to_hostname: yes
raw_config_args:
......
---
# tasks file for ansible-role-example
# tasks file for ansible-role-mod-php
- name: Assertions
assert:
that:
- ansible_os_family in ['OpenBSD', 'Debian']
- ansible_distribution_release in ['6.0', 'xenial']
- ansible_os_family == 'Debian'
- name: APT install
apt:
name: libapache2-mod-php5
state: present
update_cache: yes
cache_valid_time: 3600
---
- hosts: ansible-role-example-openbsd
gather_facts: false
roles: [openbsd_bootstrap]
- hosts: ansible-role-example-ubuntu
gather_facts: false
roles: [debian_bootstrap]
- hosts: all
roles:
- role: ansible-role-example
- role: ansible-role-mod-php
def test_mod_php(Command, Sudo):
with Sudo():
assert 'php' in Command('a2query -m').stdout
---
# vars file for ansible-role-example
# vars file for ansible-role-mod-php
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment