- name: Add vhost
import_tasks: add-vhost.yml
- when: not vhost_conf.stats.exists
+ when: not vhost_conf.stat.exists
- name: Run dehydrated for the vhost
import_tasks: dehydrated.yml
- when: not vhost_conf.stats.exists
+ when: not vhost_conf.stat.exists
- debug:
msg: "apache has already been configured"
- when: not phd_conf.stats.exists
+ when: phd_conf.stat.exists
- name: Install apache
become: true
purge: yes
state: latest
update_cache: yes
- when: not phd_conf.stats.exists
+ when: not phd_conf.stat.exists
- name: Enable SSL module
become: true
command: a2enmod ssl
notify: Reload apache
- when: not phd_conf.stats.exists
+ when: not phd_conf.stat.exists
- name: Configure apache
become: true
group: root
mode: '0640'
force: no
- when: not phd_conf.stats.exists
+ when: not phd_conf.stat.exists
- name: Enable config
become: true
command: a2enconf 001-phd
notify: Reload apache
- when: not phd_conf.stats.exists
+ when: not phd_conf.stat.exists
- name: Configure logrotate
become: true
- debug:
msg: "mc links have already been created"
- when: links_exist.results|selectattr('stat.islnk')|list|length == 3
+ when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length == 3
- name: "Setup root mc - create directories for mc links"
become: true
state: directory
mode: "0700"
loop: ['.cache', '.config', '.local/share']
- when: links_exist.results|selectattr('stat.islnk')|list|length == 3
+ when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3
- name: "Setup root mc - remove mc directories"
become: true
path: "~root/{{ item }}"
state: absent
loop: ['.cache/mc', '.config/mc', '.local/share/mc']
- when: links_exist.results|selectattr('stat.islnk')|list|length == 3
+ when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3
- name: "Setup root mc - link mc directories (1)"
become: true
src: "../.mc"
force: yes
loop: ['.cache/mc', '.config/mc']
- when: links_exist.results|selectattr('stat.islnk')|list|length == 3
+ when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3
- name: "Setup root mc - link mc directories (2)"
become: true
src: "../../.mc"
force: yes
loop: ['.local/share/mc']
- when: links_exist.results|selectattr('stat.islnk')|list|length == 3
+ when: links_exist.results|selectattr('stat.exists')|selectattr('stat.islnk')|list|length != 3
- name: "Setup root mc - overwrite files from ~phd/admin"
become: true