---
# file: roles/common/tasks/main.yaml
-- name: Ubuntu specific
- import_tasks: ubuntu_x86_64.yaml
- when: ansible_distribution|lower == 'ubuntu' and ansible_machine == 'x86_64'
+- name: Ensure the system exists in Cobbler
+ cobbler_system:
+ host: '{{ cobbler_hostname }}'
+ port: 60080
+ interfaces:
+ br1:
+ ipaddress: '{{ ansible_default_ipv4.address }}'
+ macaddress: '{{ ansible_default_ipv4.macaddress }}'
+ name: '{{ hostname }}'
+ password: '{{ cobbler_password }}'
+ properties:
+ hostname: '{{ hostname }}'
+ gateway: '{{ ansible_default_ipv4.gateway }}'
+ profile: '{{ cobbler_profile }}'
+ name_servers: '{{ name_servers }}'
+ name_servers_search: '{{ name_servers_search }}'
+ kickstart: '/var/lib/cobbler/kickstarts/{{ cobbler_profile }}.seed'
+ kernel_options: '"interface={{ ansible_default_ipv4.interface }}"'
+ netboot_enabled: yes
+ username: '{{ cobbler_username }}'
+ use_ssl: no
+ validate_certs: no
+ when: provision_enabled
+ delegate_to: localhost
+ tags: cobbler-include
-- name: Set hostname
- hostname:
- name: '{{ hostname }}'
- tags: set-hostname
+- name: Commit Cobbler changes
+ cobbler_sync:
+ host: '{{ cobbler_hostname }}'
+ port: 60080
+ password: '{{ cobbler_password }}'
+ username: '{{ cobbler_username }}'
+ use_ssl: no
+ validate_certs: no
+ run_once: yes
+ when: provision_enabled
+ delegate_to: localhost
+ register: __included_in_cobbler
+ notify:
+ - 'Boot from network'
+ - 'Reboot server'
+ tags: cobbler-include
-- name: Ensure hostname is in /etc/hosts
+- meta: flush_handlers
+
+- name: Copy netplan network config file
+ template:
+ src: 'files/netplan_config'
+ dest: '/etc/netplan/01-netcfg.yaml'
+ owner: 'root'
+ group: 'root'
+ mode: '0644'
+ tags: copy-interface-file
+
+- name: Add permanent proxy settings
lineinfile:
- path: '/etc/hosts'
- regexp: '^{{ ansible_default_ipv4.address }}.+$'
- line: '{{ ansible_default_ipv4.address }} {{ hostname }}.linuxfoundation.org'
- tags: set-hostname
+ path: '/etc/environment'
+ state: 'present'
+ line: '{{ item.key }}={{ item.value }}'
+ with_dict: '{{ proxy_env }}'
+ when: proxy_env is defined
+
+- name: Install distribution - release - machine prerequisites
+ include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
+ tags: [ install-csit-dependencies, copy-apt-sources ]
-- name: Set sudoers
+- name: Install CSIT PIP requirements
+ pip:
+ name:
+ - 'ecdsa==0.13.3'
+ - 'paramiko==2.6.0'
+ - 'pycrypto==2.6.1'
+ - 'pypcap==1.2.3'
+ - 'PyYAML==5.1.1'
+ - 'requests==2.22.0'
+ - 'robotframework==3.1.2'
+ - 'scapy==2.4.3'
+ - 'scp==0.13.2'
+ - 'ansible==2.7.8'
+ - 'dill==0.2.8.2'
+ - 'numpy==1.17.3'
+ - 'hdrhistogram==0.6.1'
+ - 'pandas==0.25.3'
+ - 'plotly==4.1.1'
+ - 'PTable==0.9.2'
+ - 'Sphinx==2.2.1'
+ - 'sphinx-rtd-theme==0.4.0'
+ - 'sphinxcontrib-programoutput==0.15'
+ - 'sphinxcontrib-robotdoc==0.11.0'
+ - 'alabaster==0.7.12'
+ - 'Babel==2.7.0'
+ - 'bcrypt==3.1.7'
+ - 'certifi==2019.9.11'
+ - 'cffi==1.13.2'
+ - 'chardet==3.0.4'
+ - 'cryptography==2.8'
+ - 'docutils==0.15.2'
+ - 'future==0.18.2'
+ - 'idna==2.8'
+ - 'imagesize==1.1.0'
+ - 'Jinja2==2.10.3'
+ - 'MarkupSafe==1.1.1'
+ - 'packaging==19.2'
+ - 'pbr==5.4.3'
+ - 'pycparser==2.19'
+ - 'Pygments==2.4.2'
+ - 'PyNaCl==1.3.0'
+ - 'pyparsing==2.4.4'
+ - 'python-dateutil==2.8.1'
+ - 'pytz==2019.3'
+ - 'retrying==1.3.3'
+ - 'six==1.13.0'
+ - 'snowballstemmer==2.0.0'
+ - 'sphinxcontrib-applehelp==1.0.1'
+ - 'sphinxcontrib-devhelp==1.0.1'
+ - 'sphinxcontrib-htmlhelp==1.0.2'
+ - 'sphinxcontrib-jsmath==1.0.1'
+ - 'sphinxcontrib-qthelp==1.0.2'
+ - 'sphinxcontrib-serializinghtml==1.1.3'
+ - 'urllib3==1.25.6'
+ tags: install-pip
+
+- name: Install CSIT PIP requirements - SciPy workaround
+ pip:
+ name:
+ - 'scipy==1.1.0'
+ tags: install-pip
+
+- name: Set sudoers admin
lineinfile:
path: '/etc/sudoers'
state: 'present'
validate: '/usr/sbin/visudo -cf %s'
tags: set-sudoers
-- name: Set sudoers
+- name: Set sudoers sudo
lineinfile:
path: '/etc/sudoers'
state: 'present'
- name: Copy grub file
template:
- src: 'files/grub'
+ src: 'files/grub_{{ ansible_machine }}'
dest: '/etc/default/grub'
owner: 'root'
group: 'root'
mode: '644'
- notify: ['Update GRUB']
+ notify:
+ - 'Update GRUB'
+ - 'Reboot server'
tags: copy-grub
+
+- name: Mellanox Install - Driver
+ import_tasks: mellanox.yaml
+ tags: mellanox-install
+
+- meta: flush_handlers