From cc7273a97779ee73dc4f9f12412d26626c6195e3 Mon Sep 17 00:00:00 2001 From: Taylor Kimball Date: Sat, 13 Oct 2018 15:02:44 -0700 Subject: [PATCH] Change: Add support for python3 and update min_ansible_version to 2.6 --- .travis.yml | 4 +++- meta/main.yml | 2 +- tasks/elrepo_kernel.yml | 16 ++++++++++++---- tasks/elrepo_repository.yml | 4 +++- tests/test.yml | 2 +- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9b79b8a..21cb6dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ --- language: python -python: "2.7" +python: + - "2.7" + - "3.6" sudo: required install: - pip install ansible diff --git a/meta/main.yml b/meta/main.yml index 3c9e554..f530642 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -5,7 +5,7 @@ galaxy_info: author: tkimball83 description: RHEL/CentOS - ELRepo Project license: GPLv3 - min_ansible_version: 2.5 + min_ansible_version: 2.6 platforms: - name: EL versions: diff --git a/tasks/elrepo_kernel.yml b/tasks/elrepo_kernel.yml index 404c3f1..11df428 100644 --- a/tasks/elrepo_kernel.yml +++ b/tasks/elrepo_kernel.yml @@ -8,11 +8,13 @@ enablerepo: "{{ elrepo_enablerepo|join(',') }}" name: "{{ item }}" state: absent - with_items: + loop: - kernel-devel - kernel-tools - kernel-tools-libs - kernel-headers + loop_control: + label: "{{ item }}" - name: Appending elrepo-kernel to elrepo_enablerepo list set_fact: @@ -29,10 +31,12 @@ name: "{{ item }}" state: present register: elrepo_kernel_installed - with_items: + loop: - "kernel-{{ elrepo_kernel_version }}" - "kernel-{{ elrepo_kernel_version }}-devel" - "kernel-{{ elrepo_kernel_version }}-headers" + loop_control: + label: "{{ item }}" - name: Ensure that the kernel tools packages are installed become: true @@ -43,9 +47,11 @@ enablerepo: "{{ elrepo_enablerepo|join(',') }}" name: "{{ item }}" state: present - with_items: + loop: - "kernel-{{ elrepo_kernel_version }}-tools" - "kernel-{{ elrepo_kernel_version }}-tools-libs" + loop_control: + label: "{{ item }}" when: - elrepo_dist == '7' - elrepo_kernel_installed is changed @@ -77,7 +83,9 @@ enablerepo: "{{ elrepo_enablerepo|join(',') }}" name: "{{ item }}" state: present - with_items: "{{ elrepo_packages }}" + loop: "{{ elrepo_packages }}" + loop_control: + label: "{{ item }}" when: - elrepo_packages|length > 0 - elrepo_yum is success diff --git a/tasks/elrepo_repository.yml b/tasks/elrepo_repository.yml index cee0cb6..993681e 100644 --- a/tasks/elrepo_repository.yml +++ b/tasks/elrepo_repository.yml @@ -70,7 +70,9 @@ enablerepo: "{{ elrepo_enablerepo|join(',') }}" name: "{{ item }}" state: present - with_items: "{{ elrepo_packages }}" + loop: "{{ elrepo_packages }}" + loop_control: + label: "{{ item }}" when: - elrepo_packages|length > 0 - elrepo_yum is success diff --git a/tests/test.yml b/tests/test.yml index 1503f04..20a8404 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -1,6 +1,6 @@ --- - hosts: localhost - remote_user: root + connection: local roles: - ansible-role-elrepo ...