CSIT-1437 Create portable host-setup document
[csit.git] / resources / tools / testbed-setup / ansible / roles / common / tasks / main.yaml
index 06058a4..1481536 100644 (file)
@@ -1,9 +1,17 @@
 ---
 # file: roles/common/tasks/main.yaml
 
+- name: Add permanent proxy settings
+  lineinfile:
+    path: "/etc/environment"
+    state: "present"
+    line: "{{ item.key }}={{ item.value }}"
+  with_dict: "{{ proxy_env }}"
+  when: proxy_env is defined
+
 - name: Ubuntu specific
-  import_tasks: ubuntu_x86_64.yaml
-  when: ansible_distribution|lower == 'ubuntu' and ansible_machine == 'x86_64'
+  import_tasks: ubuntu.yaml
+  when: ansible_distribution|lower == 'ubuntu'
 
 - name: Set hostname
   hostname:
   lineinfile:
     path: '/etc/hosts'
     regexp: '^{{ ansible_default_ipv4.address }}.+$'
-    line: '{{ ansible_default_ipv4.address }} {{ hostname }}.linuxfoundation.org'
+    line: '{{ ansible_default_ipv4.address }} {{ hostname }}.{{ domain }}'
   tags: set-hostname
 
-- name: Set sudoers
+- name: Set sudoers admin
   lineinfile:
     path: '/etc/sudoers'
     state: 'present'
@@ -26,7 +34,7 @@
     validate: '/usr/sbin/visudo -cf %s'
   tags: set-sudoers
 
-- name: Set sudoers
+- name: Set sudoers sudo
   lineinfile:
     path: '/etc/sudoers'
     state: 'present'
    mode: '644'
   notify: ['Update GRUB']
   tags: copy-grub
+
+- name: Add permanent proxy settings
+  lineinfile:
+    path: "/etc/environment"
+    state: "present"
+    line: "{{ item.key }}={{ item.value }}"
+  with_dict: "{{ proxy_env }}"
+  when: proxy_env is defined