Skip to content

Instantly share code, notes, and snippets.

@cuongnv23
Created February 16, 2017 15:07
Show Gist options
  • Select an option

  • Save cuongnv23/8b9774353bbe2b83717b9980ef35624d to your computer and use it in GitHub Desktop.

Select an option

Save cuongnv23/8b9774353bbe2b83717b9980ef35624d to your computer and use it in GitHub Desktop.
# vim:ft=ansible
- hosts: localhost
remote_user: admin
become: True
become_user: root
vars:
nginx_root_dir: "/var/www/html"
tasks:
- name: Install nginx
apt:
name: nginx
state: latest
- name: Ensure nginx start
service:
name: nginx
state: started
enabled: True
- name: Setup dead simple hello world for nginx
shell: echo "Hello World" > "{{ nginx_root_dir }}/index.html"
changed_when: False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment