Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: Configure webserver with nginx
- hosts: webservers
- become: True
- tasks:
- - name: create dir enable sites
- file:
- path:/etc/nginx/sites-enabled
- state:directory
- - name: create dir aviable sites
- file:
- path:/etc/nginx/sites-aviable
- state:directory
- - name: install nginx
- apt: name=nginx update_cache=yes
- - name: copy nginx config file
- copy: src=files/nginx.conf dest=/etc/nginx/sites-aviable/default
- - name: enable configuration
- file:
- dest=/etc/nginx/sites-enabled/default
- src=/etc/nginx/sites-aviable/default
- state=link
- - name: copy index.html
- template: src=template/index.html.j2 dest=/usr/share/nginx/html/index.html mode=0644
- - name: restart nginx
- service: name=nginx state=restarted
- #ERROR! this task 'file' has extra params, which is only allowed in the following modules: import_tasks, meta, win_command, #import_role, include, win_shell, shell, script, include_vars, include_tasks, add_host, command, include_role, set_fact, raw, group_by
- #The error appears to be in '/etc/ansible/playbooks/web-nolts.yml': line 5, column 7, but may
- #be elsewhere in the file depending on the exact syntax problem.
- #The offending line appears to be:
- # tasks:
- # - name: create dir enable sites
- # ^ here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement