Tutorial by Examples: ansible

Chef Scollector Cookbook: https://github.com/alexmbird/chef-scollector Chef Bosun Cookbook: https://github.com/ptqa/chef-bosun Puppet scollector module: https://github.com/axibase/axibase-puppet-modules Bosun Ansible/Vagrant example: https://github.com/gnosek/bosun-deploy
Ansible maintains a PPA repository that can be used to install the Ansible binaries: sudo apt-add-repository ppa:ansible/ansible -y sudo apt-get update && sudo apt-get install ansible -y To install a specific version, use pip. The PPA may be out of date.
There are two main ways way to install Ansible on OS X, either using the Homebrew or Pip package manager. If you have homebrew, the latest Ansible can be installed using the following command: brew install ansible To install Ansible 1.9.X branch use following command: brew install homebrew/ver...
ansible-playbook -i path/to/static-inventory-file -l myhost myplaybook.yml
ansible-playbook -i path/to/dynamic-inventory-script.py -l myhost myplaybook.yml See dynamic inventory for more details.
Managing AWS resources that scale up and down runs into the limits of the static inventory host file, that's why we need something dynamic. And that's what the dynamic inventories are for. Let's start: Download these ec2.ini and ec2.py files to the your project folder: cd my_ansible_project wget...
It's also possible to easily share roles with the community or download roles that have been created by other members of the community with Ansible Galaxy. Ansible ships with a command line tool called ansible-galaxy that can be used to install roles in the role directory defined in the ansible.cfg...
We can provision remote systems with Ansible. You should have an SSH key-pair and you should take your SSH public key to the machine ~/.ssh/authorized_keys file. The porpuse is you can login without any authorization. Prerequisites: Ansible You need an Inventory file (for ex.: development.ini...
Common use when: ansible_os_family == "CentOS" when: ansible_os_family == "Redhat" when: ansible_os_family == "Darwin" when: ansible_os_family == "Debian" when: ansible_os_family == "Windows" All Lists based on discuss here http://comments...
We can get facts (ansible_os_family, ansible_pkg_mgr) with Ad-Hoc command of setup module and filter. ansible_os_family: $ ansible all -m setup -a 'filter=ansible_os_family' ra.local | SUCCESS => { "ansible_facts": { "ansible_os_family": "Debi...
This is the default ansible.cfg from Ansible github. # config file for ansible -- http://ansible.com/ # ============================================== # nearly all parameters can be overridden in ansible-playbook # or with command line flags. ansible will read ANSIBLE_CONFIG, # ansible.cfg in...
The idea is to have one or more control machines from where you can issue ad-hoc commands to remote machines (via ansible tool) or run a sequenced instruction set via playbooks (via ansible-playbook tool). Basically, we use Ansible control machine, this will typically be your desktop, laptop or s...
Check the right software versions are installed: ansible >=2.0 python >=2.6 shade module for python $ansible --version ansible 2.2.0.0 $python --version Python 2.7.5 Install 'shade' the python component used to pilot openstack. $pip install shade Note : if you use a company...
Our openstack tenant is already set: a virtual lan gives instances private IP a virtual router map public IP to private IP a security key has been generated we have default firewall configuration for ssh and port 80 we are able to launch an instance thanks to the OpenStack web interface ...
Let use 'os_server' command from module 'Cloud' [http://docs.ansible.com/ansible/os_server_module.html]. Variables are defined in ./group_vars/all. $vi launch_compute.yml - name: launch a compute instance hosts: localhost gather_facts: False tasks: - name: Create and launch the VM ...
My laptop is having Windows 10. Here i am giving steps that you can follow to test and learn Ansible. SOME THEORY For Ansible you need a Control Machine and a host(or hosts) to run the Playbook. Control Machine should be Linux based or MacOS(windows not allowed) and need Python (2.6 or higher v...
It is a powerful and mostly used keyword in Ansible to run Playbook using Ad-Hoc commands Example: ansible-playbook demo.yml Further Reading on ansible-plabook
hosts: mysql tasks: name: Add mysql user user: name: mysql shell: /sbin/nologin name: install the latest version of libselinux-python yum: name: libselinux-python state: latest name: install perl yum: name: perl state: latest name: remove the mysql-libs package y...

Page 1 of 1