OpenSlides / openslides_ansible

Ansible skript to install openslides with postgres and redis
1 stars 3 forks source link

vhost config is not set #2

Open FinnStutzenstein opened 8 years ago

FinnStutzenstein commented 8 years ago

Part of the playbook:

...
TASK [openslides_ansible : Create systemd units for openslides] ****************
changed: [10.42.7.229] => (item=openslides.service)
changed: [10.42.7.229] => (item=openslides_worker@.service)

TASK [openslides_ansible : Create nginx vhost config] **************************

TASK [openslides_ansible : Create nginx global config] *************************
changed: [10.42.7.229]
...
RUNNING HANDLER [openslides_ansible : restart nginx] ***************************
fatal: [10.42.7.229]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to stop nginx.service: Access denied\nFailed to start nginx.service: Access denied\n"}

NO MORE HOSTS LEFT *************************************************************

This error is fixed by adding become: yes to the nginx restart handler. But the task 'Create nginx vhost config' is not played. In the sites-enabled directory is no nginx_vhost.conf and the default nginx site is shown in a browser.

ostcar commented 8 years ago

I always run this role with the root account, so I did not catch errors that happens with other users. Could you paste your playbook that runs this role? My is here: https://github.com/ostcar/openslides_pi

FinnStutzenstein commented 8 years ago

This playbook is mainly yours from the first repo and not as different (just one role) as yours:

 ---
 - hosts: openslides
   gather_facts: False

   vars:
     openslides_secure_key: KeyKeykey # Secure Key for django. Should be changed
     openslides_nginx_global: yes  # Let openslides listen on any nginx domain
     openslides_use_git: true

   pre_tasks:
   - name: Install python2
     become: yes
     raw: apt-get -y install python

   - setup: ''

   - name: Update System
     become: yes
     become_method: sudo
     apt:
       update_cache: yes
       upgrade: dist
       cache_valid_time: 3600

   roles:
   - openslides_ansible