2 # file: roles/common/tasks/main.yaml
4 - name: Add permanent proxy settings
6 path: "/etc/environment"
8 line: "{{ item.key }}={{ item.value }}"
9 with_dict: "{{ proxy_env }}"
10 when: proxy_env is defined
12 - name: Ubuntu specific
13 import_tasks: ubuntu.yaml
14 when: ansible_distribution|lower == 'ubuntu'
18 name: '{{ hostname }}'
21 - name: Ensure hostname is in /etc/hosts
24 regexp: '^{{ ansible_default_ipv4.address }}.+$'
25 line: '{{ ansible_default_ipv4.address }} {{ hostname }}.{{ name_servers_search }}'
28 - name: Set sudoers admin
32 regexp: '^%admin ALL='
33 line: '%admin ALL=(ALL) ALL'
34 validate: '/usr/sbin/visudo -cf %s'
37 - name: Set sudoers sudo
42 line: '%sudo ALL=(ALL:ALL) NOPASSWD: ALL'
43 validate: '/usr/sbin/visudo -cf %s'
46 - name: Copy grub file
49 dest: '/etc/default/grub'
53 notify: ['Update GRUB']
56 - name: Add permanent proxy settings
58 path: "/etc/environment"
60 line: "{{ item.key }}={{ item.value }}"
61 with_dict: "{{ proxy_env }}"
62 when: proxy_env is defined