Skip to content

Commit

Permalink
Improves variable defaults.
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-schlichtherle committed Sep 21, 2019
1 parent 073869e commit e54f4fe
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion roles/debian-down/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
ansible_become: yes
proxy_url: ''
proxy_url: None
6 changes: 3 additions & 3 deletions roles/debian-down/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
file:
path: /etc/apt/apt.conf.d/95proxies
state: absent
when: proxy_url != ''
when: proxy_url != None
- name: remove environment variables HTTP_PROXY and HTTPS_PROXY
lineinfile:
path: /etc/environment
regexp: '^\s*{{ item }}\s*='
state: absent
notify: reboot system
when: proxy_url != ''
when: proxy_url != None
with_items:
- http_proxy
- HTTP_PROXY
Expand All @@ -27,7 +27,7 @@
regexp: '^\s*{{ item }}\s*='
state: absent
notify: reboot system
when: proxy_url != ''
when: proxy_url != None
with_items:
- no_proxy
- NO_PROXY
Expand Down
2 changes: 1 addition & 1 deletion roles/debian-up/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
ansible_become: yes
locale: C.UTF-8
no_proxy: 10.0.0.0/8,127.0.0.0/8,192.168.0.0/16,*.local,localhost
proxy_url: ''
proxy_url: None
timezone: UTC
6 changes: 3 additions & 3 deletions roles/debian-up/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
path: /etc/environment
regexp: '^\s*{{ item }}\s*='
notify: reboot system
when: proxy_url != ''
when: proxy_url != None
with_items:
- no_proxy
- NO_PROXY
Expand All @@ -15,7 +15,7 @@
path: /etc/environment
regexp: '^\s*{{ item }}\s*='
notify: reboot system
when: proxy_url != ''
when: proxy_url != None
with_items:
- http_proxy
- HTTP_PROXY
Expand All @@ -25,7 +25,7 @@
template:
dest: /etc/apt/apt.conf.d/95proxies
src: 95proxies.j2
when: proxy_url != ''
when: proxy_url != None
- name: update and upgrade OS
apt:
force_apt_get: yes
Expand Down
1 change: 1 addition & 0 deletions roles/docker-up/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ docker_apt_repository: "deb https://download.docker.com/linux/{{ ansible_lsb.id.
docker_registry_mirror_url: ''
docker_version: "5:19.03.2~3-0~{{ ansible_lsb.id.lower() }}-{{ ansible_lsb.codename.lower() }}"
no_proxy: 10.0.0.0/8,127.0.0.0/8,192.168.0.0/16,*.local,localhost
proxy_url: None
2 changes: 1 addition & 1 deletion roles/docker-up/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
path: /lib/systemd/system/docker.service
regexp: '^\s*Environment\s*='
notify: restart Docker
when: proxy_url != ''
when: proxy_url != None
- meta: flush_handlers
2 changes: 1 addition & 1 deletion roles/docker-up/templates/daemon.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"log-opts": {
"max-size": "100m"
},
{% if docker_registry_mirror_url != '' %}
{% if docker_registry_mirror_url != None %}
"registry-mirrors": [
"{{ docker_registry_mirror_url }}"
],
Expand Down

0 comments on commit e54f4fe

Please sign in to comment.