Advertisement
gorkostya

error

Feb 24th, 2021
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.35 KB | None | 0 0
  1. - name: Configure webserver with nginx
  2.   hosts: webservers
  3.   become: True
  4.   tasks:
  5.     - name: create dir enable sites
  6.       file:
  7.        path:/etc/nginx/sites-enabled
  8.         state:directory
  9.  
  10.     - name: create dir aviable sites
  11.       file:
  12.        path:/etc/nginx/sites-aviable
  13.         state:directory
  14.  
  15.     - name: install nginx
  16.       apt: name=nginx update_cache=yes
  17.  
  18.     - name: copy nginx config file
  19.       copy: src=files/nginx.conf dest=/etc/nginx/sites-aviable/default
  20.  
  21.     - name: enable configuration
  22.       file:
  23.        dest=/etc/nginx/sites-enabled/default
  24.         src=/etc/nginx/sites-aviable/default
  25.         state=link
  26.  
  27.     - name: copy index.html
  28.       template: src=template/index.html.j2 dest=/usr/share/nginx/html/index.html mode=0644
  29.  
  30.     - name: restart nginx
  31.       service: name=nginx state=restarted
  32.  
  33.  
  34.  
  35. #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
  36.  
  37. #The error appears to be in '/etc/ansible/playbooks/web-nolts.yml': line 5, column 7, but may
  38. #be elsewhere in the file depending on the exact syntax problem.
  39.  
  40. #The offending line appears to be:
  41.  
  42. #  tasks:
  43. #    - name: create dir enable sites
  44. #      ^ here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement