31 lines
1.1 KiB
YAML
31 lines
1.1 KiB
YAML
---
|
|
|
|
# Etckeeper is a small fondness of mine, it semi-automatically
|
|
# keep track of /etc with git.
|
|
# Feel free to remove all this if you'rs not interested.
|
|
- name: detect etckeeper presence
|
|
shell: "which etckeeper"
|
|
ignore_errors: True
|
|
register: tmp
|
|
changed_when: False
|
|
when: checketckeeper is undefined or checketckeeper
|
|
|
|
- name: Set fact about etckeeper presence
|
|
set_fact:
|
|
etckeeper_installed: "{{ tmp.rc is defined and tmp.rc == 0 }}"
|
|
|
|
- name: Check that /etc is clean
|
|
shell: etckeeper unclean && echo "Uncommitted changes." && return 1 || return 0
|
|
changed_when: False
|
|
when: etckeeper_installed
|
|
|
|
# Autodetect if we can use HTTPS in Nginx and jenkinsUrl configs
|
|
- name: Autodetect SSL - look up certificate existence on remote host
|
|
stat:
|
|
path: "{{ nginx_vhost_ssl_certificate_file }}"
|
|
register: result
|
|
when: nginx_vhost_ssl is undefined or nginx_vhost_ssl == None
|
|
- name: Autodetect SSL - set fact
|
|
set_fact:
|
|
nginx_vhost_ssl: "{{ result.stat.exists is defined and result.stat.exists }}"
|
|
when: nginx_vhost_ssl is undefined or nginx_vhost_ssl == None
|