vhost.yml.bk 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. ---
  2. - name: Add SSH authorized key for synchronize Moudle
  3. authorized_key:
  4. user: root
  5. state: present
  6. key: "{{ lookup('file', '/root/.ssh/id_rsa.pub') }}"
  7. - name: Copy nginx.conf
  8. template: src=nginx.conf dest=/usr/local/openresty/nginx/conf/nginx.conf owner=root group=root mode=0644
  9. #- name: Remove Old Vhost Directory
  10. # local_action: file path=/tmp/vhost state=absent
  11. - name: Remove Old Vhost Directory
  12. file :
  13. path: /usr/local/openresty/nginx/conf/vhost
  14. state: absent
  15. - name: Sync Vhost Files
  16. synchronize: # need input password in command line if ssh key is none.
  17. src: vhost
  18. dest: /usr/local/openresty/nginx/conf/
  19. delete: yes
  20. # - name: Sync Vhost Config
  21. # copy: src=vhost dest=/usr/local/openresty/nginx/conf/ owner=root group=root mode=0644
  22. #
  23. - name: Sync SSL Certificate
  24. copy: src=sslkey dest=/usr/local/openresty/nginx/conf/ owner=root group=root mode=0644
  25. - name: Check Configuration
  26. shell: /usr/local/openresty/nginx/sbin/nginx -t
  27. - name: Reload /usr/local/openresty/nginx/
  28. shell: /usr/local/openresty/nginx/sbin/nginx -s reload