| 1 |
--- |
| 2 |
|
| 3 |
- hosts: all |
| 4 |
user: vagrant |
| 5 |
tasks: |
| 6 |
- group_by: key={{ ansible_distribution }} |
| 7 |
|
| 8 |
- hosts: Ubuntu |
| 9 |
gather_facts: False |
| 10 |
tasks: |
| 11 |
- name: Install all prerequisites from vars |
| 12 |
apt: pkg={{ item }} state=installed update_cache=yes |
| 13 |
with_items: |
| 14 |
- ${ubuntu_package} |
| 15 |
|
| 16 |
- hosts: Debian |
| 17 |
gather_facts: False |
| 18 |
tasks: |
| 19 |
- name: Install all prerequisites from vars |
| 20 |
apt: pkg={{ item }} state=installed update_cache=yes |
| 21 |
with_items: |
| 22 |
- ${debian_package} |
| 23 |
|
| 24 |
- hosts: CentOS |
| 25 |
gather_facts: False |
| 26 |
tasks: |
| 27 |
- name: Install all prerequisites from vars |
| 28 |
apt: pkg={{ item }} state=installed update_cache=yes |
| 29 |
with_items: |
| 30 |
- ${centos_package} |
| 31 |
- name: Install pip prerequisites |
| 32 |
pip: name={{ item }} state=present virtualenv=/home/vagrant/virtualenv |
| 33 |
with_items: |
| 34 |
- ${pip_package} |
| 35 |
|
| 36 |
- hosts: Fedora |
| 37 |
gather_facts: False |
| 38 |
tasks: |
| 39 |
- name: Install all prerequisites from vars |
| 40 |
apt: pkg={{ item }} state=installed update_cache=yes |
| 41 |
with_items: |
| 42 |
- ${fedora_package} |
| 43 |
|
| 44 |
- hosts: all |
| 45 |
gather_facts: False |
| 46 |
tasks: |
| 47 |
- name: clone Juniper repos |
| 48 |
git: repo={{ item.url }} dest=/home/vagrant/{{ item.path }} update=no |
| 49 |
with_items: |
| 50 |
- { url: '${ncclient.url}', path: 'ncclient' } |
| 51 |
- { url: '${py-junos-eznc.url}', path: 'py-junos-eznc' } |
| 52 |
- name: install Juniper python modules |
| 53 |
command: /usr/bin/python setup.py install chdir=/home/vagrant/{{ item.path }} creates={{ item.installdir }} |
| 54 |
with_items: |
| 55 |
- { installdir: '${ncclient.installdir}', path: 'ncclient' } |
| 56 |
- { installdir: '${py-junos-eznc.installdir}', path: 'py-junos-eznc' } |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|