diff options
author | 2019-10-16 16:25:41 +0000 | |
---|---|---|
committer | 2019-10-17 08:14:25 +0000 | |
commit | d3e0654a57aa958aaef1906e4a759e521655a86b (patch) | |
tree | cc0548cf87706dee62451a07add29bbb398e30eb /resources/tools/testbed-setup/ansible/roles/tg_sut/tasks | |
parent | bf0ea7aee82f32752c4b1a3abc1f60294fbc1f40 (diff) |
Ansible: Role cleanup
+ Separate and reuse role (better naming)
+ Cleanup in naming
+ Introduce defaults that can be overriden
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: Iedaf7caba1d05a35a6f61cd21a483cdbc0073d32
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/tg_sut/tasks')
5 files changed, 0 insertions, 224 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/aarch64.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/aarch64.yaml deleted file mode 100644 index 433ccc0eb6..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/aarch64.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -# file: roles/tg_sut/tasks/aarch64.yaml - -- name: Configure {{ ansible_machine }} kernel parameters - lineinfile: - path: '/etc/default/grub' - state: 'present' - regexp: '^GRUB_CMDLINE_LINUX=' - line: 'GRUB_CMDLINE_LINUX="isolcpus={{ grub.isolcpus }} nohz_full={{ grub.nohz_full }} rcu_nocbs={{ grub.rcu_nocbs }} intel_iommu=on nmi_watchdog=0 audit=0 nosoftlockup processor.max_cstate=1"' - notify: - - 'Update GRUB' - tags: set-grub diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml deleted file mode 100644 index 41985a367c..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml +++ /dev/null @@ -1,57 +0,0 @@ ---- -# file: roles/tg_sut/tasks/main.yaml - -- name: Install distribution - release - machine prerequisites - include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml' - tags: [ install-csit-dependencies, install-docker, install-kubernetes ] - -- name: Machine specifics - include_tasks: '{{ ansible_machine }}.yaml' - tags: set-grub - -- name: Turbo boost - import_tasks: turbo_boost.yaml - when: > - cpu_microarchitecture == "skylake" or - cpu_microarchitecture == "cascadelake" - tags: turbo-boost - -- name: Copy CSIT sysctl file - template: - src: 'files/90-csit' - dest: '/etc/sysctl.d/90-csit.conf' - owner: 'root' - group: 'root' - mode: '0644' - tags: copy-90-csit - -- name: Copy IRQ load balancing file - copy: - src: 'files/irqbalance' - dest: '/etc/default/irqbalance' - owner: 'root' - group: 'root' - mode: '0644' - tags: copy-irq - -- name: Copy cpufrequtils file - copy: - src: 'files/cpufrequtils' - dest: '/etc/default/cpufrequtils' - owner: 'root' - group: 'root' - mode: '0644' - tags: copy-cpufrequtils - -- name: Set ondemand service to disable - service: - name: 'ondemand' - enabled: 'no' - tags: set-ondemand - -- name: Load vfio-pci by default - lineinfile: - path: '/etc/modules' - state: 'present' - line: 'vfio-pci' - tags: load-vfio-pci diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/turbo_boost.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/turbo_boost.yaml deleted file mode 100644 index 2fa704cdb0..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/turbo_boost.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# file: roles/tg_sut/tasks/turbo_boost.yaml - -- name: Turbo boost - Install msr-tools - apt: - name: - - 'msr-tools' - state: 'present' - cache_valid_time: 3600 - install_recommends: False - tags: turbo-boost - -- name: Turbo boost - Load msr by default - lineinfile: - path: '/etc/modules' - state: 'present' - line: 'msr' - tags: turbo-boost - -- name: Turbo boost - Custom startup service hook - copy: - src: 'files/disable-turbo-boost.service' - dest: '/etc/systemd/system/disable-turbo-boost.service' - owner: 'root' - group: 'root' - mode: '0644' - tags: turbo-boost - -- name: Turbo boost - Custom startup service hook enable - service: - name: 'disable-turbo-boost' - enabled: yes - tags: turbo-boost diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu_bionic.yaml deleted file mode 100644 index fed589c432..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu_bionic.yaml +++ /dev/null @@ -1,109 +0,0 @@ ---- -# file: roles/tg_sut/tasks/ubuntu_bionic.yaml - -- name: Install CSIT dependencies - apt: - name: - - 'apt-transport-https' - - 'ca-certificates' - - 'software-properties-common' - state: 'present' - cache_valid_time: 3600 - install_recommends: False - tags: install-csit-dependencies - -- name: Add an Apt signing key, for docker-ce repository - apt_key: - url: https://download.docker.com/linux/ubuntu/gpg - state: 'present' - tags: install-docker - -- name: Install Docker APT repository - apt_repository: - repo: '{{ docker_repository }}' - state: 'present' - update_cache: True - tags: install-docker - -- name: Install Docker - apt: - name: 'docker-{{ docker_edition }}={{ docker_apt_package_name }}' - state: 'present' - force: yes - tags: install-docker - -- name: Creates Docker service directory - file: - path: '/etc/systemd/system/docker.service.d' - state: 'directory' - tags: install-docker - -- name: Setup Docker http proxy - template: - src: 'templates/docker.service.proxy.http' - dest: '/etc/systemd/system/docker.service.d/http-proxy.conf' - owner: 'root' - group: 'root' - mode: '0644' - register: docker_register_systemd_service - when: proxy_env is defined and proxy_env.http_proxy is defined - tags: install-docker - -- name: Setup Docker https proxy - template: - src: 'templates/docker.service.proxy.https' - dest: '/etc/systemd/system/docker.service.d/https-proxy.conf' - owner: 'root' - group: 'root' - mode: '0644' - register: docker_register_systemd_service - when: proxy_env is defined and proxy_env.https_proxy is defined - tags: install-docker - -- name: Reload systemd daemon - command: 'systemctl daemon-reload' - notify: ['Restart Docker'] - when: (docker_register_systemd_service and - docker_register_systemd_service is changed) - tags: install-docker - -- name: Set specific users to docker group - user: - name: '{{ item }}' - groups: 'docker' - append: True - with_items: '{{ docker_users }}' - when: docker_users - tags: install-docker - -- name: Add an Apt signing key, for Kubernetes repository - apt_key: - url: https://packages.cloud.google.com/apt/doc/apt-key.gpg - state: 'present' - tags: install-kubernetes - -- name: Install kubernetes APT repository - apt_repository: - repo: '{{ kubernetes.repository }}' - state: 'present' - update_cache: True - tags: install-kubernetes - -- name: Install Kubernetes - apt: - name: - - 'kubernetes-cni=0.6.0-00' - - 'kubeadm={{ kubernetes.version }}' - - 'kubectl={{ kubernetes.version }}' - - 'kubelet={{ kubernetes.version }}' - state: 'present' - force: yes - tags: install-kubernetes - -- name: Apply kubelet parameter - lineinfile: - path: '/etc/default/kubelet' - state: 'present' - regexp: '^KUBELET_EXTRA_ARGS=*' - line: 'KUBELET_EXTRA_ARGS=--feature-gates HugePages=false' - tags: install-kubernetes diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/x86_64.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/x86_64.yaml deleted file mode 100644 index 5b705eacb8..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/x86_64.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# file: roles/tg_sut/tasks/x86_64.yaml - -- name: Configure {{ ansible_machine }} kernel parameters - lineinfile: - path: '/etc/default/grub' - state: 'present' - regexp: '^GRUB_CMDLINE_LINUX=' - line: 'GRUB_CMDLINE_LINUX="isolcpus={{ grub.isolcpus }} nohz_full={{ grub.nohz_full }} rcu_nocbs={{ grub.rcu_nocbs }} numa_balancing=disable intel_pstate=disable intel_iommu=on iommu=pt nmi_watchdog=0 audit=0 nosoftlockup processor.max_cstate=1 intel_idle.max_cstate=1 hpet=disable tsc=reliable mce=off"' - notify: - - 'Update GRUB' - - 'Reboot server' - tags: set-grub |