You are on page 1of 1

# vim master_playbook.

yml
---
#installing nginx and postgresql

- name: Updating apt command: sudo apt-get update


- name: Install list of packages apt: pkg: ['nginx', 'postgresql'] state: latest
- name: Start Ngnix service service: name: nginx state: started
- name: Start PostgreSQL service service: name: postgresql state: started

$ansible-playbook -i vyos.example.net, -u ansible -k -e ansible_network_os=vyos


master_playbook.yml

ansible-playbook master_playbook.yml -f 10

ansible-playbook main.yml -f 10
sudo service nginx start

sudo service nginx restart

ansible-playbook mainplaybook.yml
state=installed
---
#installing nginx and postgresql

- name: Install nginx


apt: name=nginx state=latest
tags: nginx

- name: restart nginx


service:
name: nginx
state: started

- name: Install PostgreSQL


apt: name=postgresql state=latest
tags: PostgreSQL

- name: Start PostgreSQL


service:
name: postgresql
state: started

You might also like