diff --git a/nginx.play b/nginx.play new file mode 100644 index 0000000000000000000000000000000000000000..c8790e19071787ba9fef7d270947c8ec6f09048d --- /dev/null +++ b/nginx.play @@ -0,0 +1,45 @@ +--- +- hosts: 16.0.0.1 + gather_facts: no + become: yes + vars: + ansible_ssh_private_key_file: "/home/user1/.ssh/openstack.key" + ansible_ssh_user: "ubuntu" + tasks: + - name: Update repositories + apt: + update_cache: yes + + - name: Install nginx + package: + name: nginx + + - name: Start nginx + service: + name: nginx + enabled: yes + state: started + + - name: Set attributes + set_stats: + data: + site_config_dir: /etc/nginx/conf.d + + - name: Install sample site + copy: + dest: "" + content: | + <!doctype html> + <html lang="en"> + <head> + <title>Hello World!</title> + </head> + <body> + <h1>Sample web page</h1> + <p>With little content ;)</p> + </body> + </html> + with_items: + - /var/www/html/index.html + - /usr/share/nginx/html/index.html +