[Charlotte-pm] Is there an Ansible solution to this deployment process?

Yanick Champoux yanick at babyl.ca
Thu Aug 26 09:20:26 PDT 2021


## Step 6 of ?: set up nginx

For the nginx config, let's leverage the handlers so that we'll only
reload nginx if we change the config.

```
# in roles/onboard/handlers/main.yml
- name: restart nginx
  service: name=nginx state=restarted
  become: yes
```

and the task file then becomes:

```
# in roles/onboard/tasks/setup_nginx.yml

- name: copy config
  copy:
    src: ../files/nginx.conf
    dest: /etc/nginx/sites-enabled/{{sitename}}-nginx.conf
  notify: restart nginx
```



More to come,
`/anick`
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/charlotte-pm/attachments/20210826/40f8f2fd/attachment.html>


More information about the Charlotte-pm mailing list