Ansible Presentation
Ansible Presentation
A brief overview
Robin Long
June 22, 2016
• Lightweight.
• Simple.
• It is its own documentation.
• Forces better practises.
[storage-nodes]
stor[000:031].hec.lancs.ac.uk
[service-nodes]
fal-pygrid-15.lancs.ac.uk
fal-pygrid-30
[loki]
py-loki.lancs.ac.uk:222
[norse]
py-loki.lancs.ac.uk:222
py-eir.lancs.ac.uk
---
- hosts: webservers
vars:
http_port: 80
max_clients: 200
remote_user: root
tasks:
- name: ensure apache is at the latest version
yum: name=httpd state=latest
- name: write the apache config file
template: src=/https/www.scribd.com/srv/httpd.j2 dest=/etc/httpd.conf
notify:
- restart apache
- name: ensure apache is running (and enable it at boot)
service: name=httpd state=started enabled=yes
handlers:
- name: restart apache
service: name=httpd state=restarted
tasks:
- name: ensure apache is at the latest version
yum:
name: httpd
state: latest
- name: write the apache config file
template:
src: /srv/httpd.j2
dest: /etc/httpd.conf
notify:
- restart apache
- name: ensure apache is running (and enable it at boot)
service:
name: httpd
state: started
enabled: yes
handlers:
- name: restart apache
service:
name: httpd
state: restarted
Robin Long (Lancaster University) Ansible June 22, 2016 10 / 1
Ansible - Playbooks
• execute by running
ansible-playbook playbook.yml -f 10
---
- hosts: webservers
roles:
- common
- storage-servers
---
SITEURLS:
HEC: carceri.hec.lancs.ac.uk
DPM: fal-pygrid-30.lancs.ac.uk
SITEBDII ldap://py-fjalar.hec.lancs.ac.uk:2170/mds-vo-name=resource,o=grid
DPM ldap://fal-pygrid-30.lancs.ac.uk:2170/mds-vo-name=resource,o=grid
HEC ldap://carceri.hec.lancs.ac.uk:2170/mds-vo-name=resource,o=grid
group_vars/
all
bdii-site
cvmfs-client
loki
service-nodes
squid
storage-nodes
vac
OTHERINFO:
- GRID=EGEE
- GRID=GRIDPP
- GRID=WLCG
- GRID=NORTHGRID
- TIER=2
SITEURLS:
HEC: carceri.hec.lancs.ac.uk
DPM: fal-pygrid-30.lancs.ac.uk
Robin Long (Lancaster University) Ansible June 22, 2016 21 / 1
Collaborate?