Giter Site home page Giter Site logo

ansible-roles-example's Introduction

Collection of Ansible Roles

All the roles expose variables that can be overridden through host/group variables. These variables are documented on the relevant role's README.

Usage

  1. Create an Ansible project or clone this repo as a starting point. The structure looks something like this.
/my-ansible-project/
  /group_vars/
  /host_vars/
  /roles/ - Subtree (http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/) pull from the subprojects
  /production - Production inventory file
  /development - Development inventory file
  /playbook.yml
  1. Create an inventory file

/production_inventory

[web1]
192.168.33.100 ansible_ssh_user=vagrant

[web2]
192.168.33.101 ansible_ssh_user=vagrant

[webservers:children]
web1
web2
  1. Override some variables

/host_vars/web1

php_extensions:
  - php5-mcrypt
php5_fpm_pools:
  - name: my_service
    prefix: /var
    user: vagrant
    group: vagrant
    socket_listen_owner: nginx
    socket_listen_group: nginx
    process_max_requests: 500
    access_log_path: /var/log/php5-fpm-$pool.access.log
nginx_service_enabled: no
  1. Create a playbook and add some roles

/my_playbook.yml

- hosts: webservers
  roles:
    - common
    - nginx
    - php5
    - php5-fpm

Running

ansible-playbook my-playbook.yml -i inventory_file [-u vagrant] [--private-key=~/.ssh/my-private-key]

Available Roles

ansible-roles-example's People

Contributors

larryweya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.