Преглед изворни кода

Make changes in /etc/hosts and /etc/hosts.deny disabled by default

Emmanuel Bouthenot пре 6 година
родитељ
комит
710506cf03
2 измењених фајлова са 4 додато и 2 уклоњено
  1. 2 0
      roles/common/defaults/main.yml
  2. 2 2
      roles/common/tasks/base.yml

+ 2 - 0
roles/common/defaults/main.yml

@@ -12,6 +12,8 @@ locale: 'en_US.UTF-8'
 timezone_area: 'Europe'
 timezone_city: 'Paris'
 
+with_hosts: False
+with_hostsdeny: False
 hosts_fqdn: True
 hosts_static_lookup: Null
 

+ 2 - 2
roles/common/tasks/base.yml

@@ -1,10 +1,10 @@
 - name: 'Install hosts file'
   template: src=hosts.j2 dest=/etc/hosts owner=root group=root mode=0644
-  notify:
-    - 'Update motd'
+  when: with_hosts
 
 - name: 'Install hosts.deny file'
   template: src=hosts.deny.j2 dest=/etc/hosts.deny owner=root group=root mode=0644
+  when: with_hostsdeny
 
 - name: 'Write /etc/apt/sources.list'
   template: src=apt/sources.{{ ansible_lsb.codename }}.list.j2 dest=/etc/apt/sources.list owner=root group=root mode=0644