diff options
Diffstat (limited to 'ansible')
-rw-r--r-- | ansible/build_yardstick_image.yml | 8 | ||||
-rw-r--r-- | ansible/install.yaml | 2 | ||||
-rw-r--r-- | ansible/roles/configure_rabbitmq/tasks/main.yml | 20 | ||||
-rw-r--r-- | ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 | 5 | ||||
-rw-r--r-- | ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 | 23 | ||||
-rw-r--r-- | ansible/roles/enable_iommu_on_boot/tasks/main.yml | 94 | ||||
-rwxr-xr-x | ansible/roles/install_dependencies_jumphost/tasks/Debian.yml | 6 | ||||
-rwxr-xr-x | ansible/roles/install_dpdk/tasks/Debian.yml | 1 |
8 files changed, 69 insertions, 90 deletions
diff --git a/ansible/build_yardstick_image.yml b/ansible/build_yardstick_image.yml index 072c12c66..495a547bb 100644 --- a/ansible/build_yardstick_image.yml +++ b/ansible/build_yardstick_image.yml @@ -19,11 +19,13 @@ 'amd64': disk1 'arm64': uefi1 boot_mode: "{{ boot_modes[YARD_IMG_ARCH] }}" - image_filename: "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}-{{ boot_mode }}.img" - image_path: "{{ release }}/current/{{ image_filename }}" + image_filename: + 'xenial': "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}-{{ boot_mode }}.img" + 'bionic': "{{ release }}-server-cloudimg-{{ YARD_IMG_ARCH }}.img" + image_path: "{{ release }}/current/{{ image_filename[release] }}" host: "{{ lookup('env', 'HOST')|default('cloud-images.ubuntu.com', true)}}" image_url: "{{ lookup('env', 'IMAGE_URL')|default('https://' ~ host ~ '/' ~ image_path, true) }}" - image_dest: "{{ workspace }}/{{ image_filename }}" + image_dest: "{{ workspace }}/{{ image_filename[release] }}" sha256sums_path: "{{ release }}/current/SHA256SUMS" sha256sums_filename: "{{ sha256sums_path|basename }}" sha256sums_url: "{{ lookup('env', 'SHA256SUMS_URL')|default('https://' ~ host ~ '/' ~ sha256sums_path, true) }}" diff --git a/ansible/install.yaml b/ansible/install.yaml index 084cdcef3..0c7ad7e92 100644 --- a/ansible/install.yaml +++ b/ansible/install.yaml @@ -39,7 +39,7 @@ - { role: configure_gui, when: installation_mode != inst_mode_container_pull } - { role: download_trex, when: installation_mode != inst_mode_container_pull } - { role: install_trex, when: installation_mode != inst_mode_container_pull } - - { role: configure_rabbitmq, when: installation_mode != inst_mode_container_pull } + - { role: configure_rabbitmq, when: installation_mode == inst_mode_baremetal } post_tasks: diff --git a/ansible/roles/configure_rabbitmq/tasks/main.yml b/ansible/roles/configure_rabbitmq/tasks/main.yml index 4ff4222dc..3ad60c1ea 100644 --- a/ansible/roles/configure_rabbitmq/tasks/main.yml +++ b/ansible/roles/configure_rabbitmq/tasks/main.yml @@ -12,16 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -- name: Create rabbitmq configuration - template: - src: rabbitmq.config.j2 - dest: /etc/rabbitmq/rabbitmq.config - -- name: Define user definitions file - template: - src: user_definitions.json.j2 - dest: /etc/rabbitmq/definitions.json - - name: Restart rabbitmq service: name: rabbitmq-server @@ -30,5 +20,11 @@ - name: rabbitmqctl start_app shell: rabbitmqctl start_app -- name: Enable management plugin - shell: rabbitmq-plugins enable rabbitmq_management +- name: Configure rabbitmq + rabbitmq_user: + user: yardstick + password: yardstick + configure_priv: .* + read_priv: .* + write_priv: .* + state: present diff --git a/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 b/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 deleted file mode 100644 index 8f07edf5c..000000000 --- a/ansible/roles/configure_rabbitmq/templates/rabbitmq.config.j2 +++ /dev/null @@ -1,5 +0,0 @@ - [
- {rabbitmq_management, [
- {load_definitions, "/etc/rabbitmq/definitions.json"}
- ]}
-].
\ No newline at end of file diff --git a/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 b/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 deleted file mode 100644 index 7c811f16d..000000000 --- a/ansible/roles/configure_rabbitmq/templates/user_definitions.json.j2 +++ /dev/null @@ -1,23 +0,0 @@ - {
- "users": [{
- "name": "yardstick",
- "password_hash": "XHp9fBOE3vjTEf7ktiUBHqefW2g=",
- "hashing_algorithm": "rabbit_password_hashing_sha256",
- "tags": ""
- }],
- "vhosts": [{
- "name": "/"
- }],
- "permissions": [{
- "user": "yardstick",
- "vhost": "/",
- "configure": ".*",
- "write": ".*",
- "read": ".*"
- }],
- "parameters": [],
- "policies": [],
- "queues": [],
- "exchanges": [],
- "bindings": []
-}
diff --git a/ansible/roles/enable_iommu_on_boot/tasks/main.yml b/ansible/roles/enable_iommu_on_boot/tasks/main.yml index e406fcc1e..188b32915 100644 --- a/ansible/roles/enable_iommu_on_boot/tasks/main.yml +++ b/ansible/roles/enable_iommu_on_boot/tasks/main.yml @@ -22,55 +22,57 @@ iommu_boot_params: ' amd_iommu=on iommu=pt' when: hostvars[inventory_hostname]['ansible_system_vendor'] == "AuthenticAMD" -- name: Define grub string for IOMMU - set_fact: - enable_iommu: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX{{ iommu_boot_params }}' +- block: + - name: Define grub string for IOMMU + set_fact: + enable_iommu: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX{{ iommu_boot_params }}' -- name: check if iommu is set by this role in {{ grub_file}} - lineinfile: - path: "{{ grub_file}}" - regexp: '{{ iommu_help_string }}' - line: '{{ iommu_help_string }}' - state: absent - check_mode: yes - register: is_nsb_iommu_role - ignore_errors: True + - name: check if iommu is set by this role in {{ grub_file}} + lineinfile: + path: "{{ grub_file}}" + regexp: '{{ iommu_help_string }}' + line: '{{ iommu_help_string }}' + state: absent + check_mode: yes + register: is_nsb_iommu_role + ignore_errors: True -- name: Check if IOMMU is set by someone else - lineinfile: - path: "{{ grub_file}}" - regexp: "_iommu=" - line: '{{ iommu_help_string }}' - state: absent - check_mode: yes - register: is_iommu - ignore_errors: True + - name: Check if IOMMU is set by someone else + lineinfile: + path: "{{ grub_file}}" + regexp: "_iommu=" + line: '{{ iommu_help_string }}' + state: absent + check_mode: yes + register: is_iommu + ignore_errors: True -- name: Send info that IOMMU is configured by someone else - debug: - msg: "INFO: NOT modified, IOMMU is already configured by someone." - when: - - not is_nsb_iommu_role.changed - - is_iommu.changed + - name: Send info that IOMMU is configured by someone else + debug: + msg: "INFO: NOT modified, IOMMU is already configured by someone." + when: + - not is_nsb_iommu_role.changed + - is_iommu.changed -- name: Add IOMMU when it is not set - lineinfile: - path: "{{ grub_file }}" - regexp: "{{ iommu_help_string }}" - line: '{{ enable_iommu }}" {{ iommu_help_string }}' - when: - - not is_nsb_iommu_role.changed - - not is_iommu.changed + - name: Add IOMMU when it is not set + lineinfile: + path: "{{ grub_file }}" + regexp: "{{ iommu_help_string }}" + line: '{{ enable_iommu }}" {{ iommu_help_string }}' + when: + - not is_nsb_iommu_role.changed + - not is_iommu.changed -- name: find boot grub.cfg - find: - paths: /boot - file_type: file - patterns: 'grub*.cfg' - recurse: yes - register: grub_files + - name: find boot grub.cfg + find: + paths: /boot + file_type: file + patterns: 'grub*.cfg' + recurse: yes + register: grub_files -- include: manual_modify_grub.yml - # only tested on Ubuntu, kernel line is probably different on other distros - with_items: "{{ grub_files.files }}" - when: ansible_distribution == "Ubuntu" + - include: manual_modify_grub.yml + # only tested on Ubuntu, kernel line is probably different on other distros + with_items: "{{ grub_files.files }}" + when: ansible_distribution == "Ubuntu" + when: iommu_boot_params is defined diff --git a/ansible/roles/install_dependencies_jumphost/tasks/Debian.yml b/ansible/roles/install_dependencies_jumphost/tasks/Debian.yml index 419f81bfd..6c3900d26 100755 --- a/ansible/roles/install_dependencies_jumphost/tasks/Debian.yml +++ b/ansible/roles/install_dependencies_jumphost/tasks/Debian.yml @@ -16,6 +16,12 @@ apt: update_cache: yes +- name: Install dependency for Ubuntu 18 + action: "{{ ansible_pkg_mgr }} name=libssl1.0-dev state=present" + when: + - ansible_distribution == 'Ubuntu' + - ansible_distribution_major_version|int >= 17 + - name: Install core packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: diff --git a/ansible/roles/install_dpdk/tasks/Debian.yml b/ansible/roles/install_dpdk/tasks/Debian.yml index 4f0c3c881..b76a0fbf8 100755 --- a/ansible/roles/install_dpdk/tasks/Debian.yml +++ b/ansible/roles/install_dpdk/tasks/Debian.yml @@ -17,6 +17,7 @@ with_items: - libpcap-dev - pciutils + - libelf-dev - name: Install kernel headers action: "{{ ansible_pkg_mgr }} name=linux-headers-{{ dpdk_kernel }} state=present" |