2022-08-08 14:24:58 +02:00
|
|
|
# Copyright (c) 2020, Berkhan Berkdemir
|
|
|
|
# Copyright (c) 2021, Alexei Znamensky
|
2022-08-05 12:28:29 +02:00
|
|
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2021-04-18 10:55:47 +02:00
|
|
|
|
|
|
|
- name: bail out for non-supported platforms
|
|
|
|
meta: end_play
|
|
|
|
when:
|
|
|
|
- (ansible_os_family != "RedHat" or ansible_distribution_major_version|int < 7)
|
|
|
|
- ansible_os_family != "Debian"
|
|
|
|
|
|
|
|
- name: install perl development package for Red Hat family
|
|
|
|
package:
|
|
|
|
name:
|
|
|
|
- perl-devel
|
|
|
|
- perl-App-cpanminus
|
|
|
|
state: present
|
2023-02-15 22:55:23 +01:00
|
|
|
become: true
|
2021-04-18 10:55:47 +02:00
|
|
|
when: ansible_os_family == "RedHat"
|
|
|
|
|
|
|
|
- name: install perl development package for Debian family
|
|
|
|
package:
|
|
|
|
name:
|
|
|
|
- cpanminus
|
|
|
|
state: present
|
2023-02-15 22:55:23 +01:00
|
|
|
become: true
|
2021-04-18 10:55:47 +02:00
|
|
|
when: ansible_os_family == "Debian"
|
|
|
|
|
|
|
|
- name: install a Perl package
|
|
|
|
cpanm:
|
|
|
|
name: JSON
|
2023-02-15 22:55:23 +01:00
|
|
|
notest: true
|
2021-04-18 10:55:47 +02:00
|
|
|
register: install_perl_package_result
|
|
|
|
|
|
|
|
- name: assert package is installed
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- install_perl_package_result is changed
|
|
|
|
- install_perl_package_result is not failed
|
|
|
|
|
|
|
|
- name: install same Perl package
|
|
|
|
cpanm:
|
|
|
|
name: JSON
|
2023-02-15 22:55:23 +01:00
|
|
|
notest: true
|
2021-04-18 10:55:47 +02:00
|
|
|
register: install_same_perl_package_result
|
|
|
|
|
|
|
|
- name: assert same package is installed
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- install_same_perl_package_result is not changed
|
|
|
|
- install_same_perl_package_result is not failed
|
|
|
|
|
|
|
|
- name: install a Perl package with version operator
|
|
|
|
cpanm:
|
|
|
|
name: JSON
|
|
|
|
version: "@4.01"
|
2023-02-15 22:55:23 +01:00
|
|
|
notest: true
|
2021-04-18 10:55:47 +02:00
|
|
|
mode: new
|
|
|
|
register: install_perl_package_with_version_op_result
|
|
|
|
|
|
|
|
- name: assert package with version operator is installed
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- install_perl_package_with_version_op_result is changed
|
|
|
|
- install_perl_package_with_version_op_result is not failed
|