CSIT-1477: add 1n_tx2 VPP Device
[csit.git] / resources / tools / testbed-setup / ansible / roles / common / tasks / main.yaml
1 ---
2 # file: roles/common/tasks/main.yaml
3
4 - name: Ensure the system exists in Cobbler
5   cobbler_system:
6     host: '{{ cobbler_hostname }}'
7     port: 60080
8     interfaces:
9       br1:
10         ipaddress: '{{ ansible_default_ipv4.address }}'
11         macaddress: '{{ ansible_default_ipv4.macaddress }}'
12     name: '{{ hostname }}'
13     password: '{{ cobbler_password }}'
14     properties:
15       hostname: '{{ hostname }}'
16       gateway: '{{ ansible_default_ipv4.gateway }}'
17       profile: '{{ cobbler_profile }}'
18       name_servers: '{{ name_servers }}'
19       name_servers_search: '{{ name_servers_search }}'
20       kickstart: '/var/lib/cobbler/kickstarts/{{ cobbler_profile }}.seed'
21       kernel_options: '"interface={{ ansible_default_ipv4.interface }}"'
22       netboot_enabled: yes
23     username: '{{ cobbler_username }}'
24     use_ssl: no
25     validate_certs: no
26   when: provision_enabled
27   delegate_to: localhost
28   tags: cobbler-include
29
30 - name: Commit Cobbler changes
31   cobbler_sync:
32     host: '{{ cobbler_hostname }}'
33     port: 60080
34     password: '{{ cobbler_password }}'
35     username: '{{ cobbler_username }}'
36     use_ssl: no
37     validate_certs: no
38   run_once: yes
39   when: provision_enabled
40   delegate_to: localhost
41   register: __included_in_cobbler
42   notify:
43     - 'Boot from network'
44     - 'Reboot server'
45   tags: cobbler-include
46
47 - meta: flush_handlers
48
49 - name: Add permanent proxy settings
50   lineinfile:
51     path: '/etc/environment'
52     state: 'present'
53     line: '{{ item.key }}={{ item.value }}'
54   with_dict: '{{ proxy_env }}'
55   when: proxy_env is defined
56
57 - name: Install distribution - release - machine prerequisites
58   include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
59
60 - name: Set sudoers admin
61   lineinfile:
62     path: '/etc/sudoers'
63     state: 'present'
64     regexp: '^%admin ALL='
65     line: '%admin ALL=(ALL) ALL'
66     validate: '/usr/sbin/visudo -cf %s'
67   tags: set-sudoers
68
69 - name: Set sudoers sudo
70   lineinfile:
71     path: '/etc/sudoers'
72     state: 'present'
73     regexp: '^%sudo'
74     line: '%sudo ALL=(ALL:ALL) NOPASSWD: ALL'
75     validate: '/usr/sbin/visudo -cf %s'
76   tags: set-sudoers
77
78 - name: Copy grub file
79   template:
80    src: 'files/grub_{{ ansible_machine }}'
81    dest: '/etc/default/grub'
82    owner: 'root'
83    group: 'root'
84    mode: '644'
85   notify:
86     - 'Update GRUB'
87     - 'Reboot server'
88   tags: copy-grub
89
90 - meta: flush_handlers

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.