From a49bcee3e1a58a4803c1c41ebd7a1df6b89d45f3 Mon Sep 17 00:00:00 2001 From: Dougal Seeley Date: Sun, 8 Oct 2023 10:09:03 +0100 Subject: [PATCH] Previous documentation was that booleans were defined as `yes`/ `no` (https://github.com/ansible-community/community-topics/issues/116). This was changed in https://github.com/ansible/ansible/issues/78921 to use `true`/ `false`. Do not use release candidates or alpha releases in Jenkinsfiles --- README.md | 7 +++---- galaxy.yml | 4 ++-- jenkinsfiles/Jenkinsfile_release_tag | 2 +- jenkinsfiles/Jenkinsfile_release_tag__auto | 2 +- plugins/modules/blockdevmap.py | 4 ++-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1d0f2b6..1f4a117 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Ansible Collection - dseeley.blockdevmap -An Ansible module (or python script) to map cloud-specific (AWS, GCP and Azure) block device names (e.g. /dev/sdf) with the volume provided to the OS. - +An Ansible module to map cloud-specific (AWS, GCP, Azure, LibVirt) block device names (e.g. /dev/sdf) with the volume provided to the OS. ## Output ### Common @@ -31,13 +30,13 @@ This can be run as an Ansible module (needs root): - name: Get block device map information for cloud blockdevmap: cloud_type: - become: yes + become: true register: r__blockdevmap - name: Get lsblk device map information blockdevmap: cloud_type: lsblk - become: yes + become: true register: r__blockdevmap - name: debug blockdevmap diff --git a/galaxy.yml b/galaxy.yml index 20a0a2f..eb6469e 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -9,14 +9,14 @@ readme: README.md authors: - Dougal Seeley -description: An Ansible module to map cloud-specific (AWS, GCP and Azure) block device names (e.g. /dev/sdf) with the volume provided to the OS. +description: An Ansible module to map cloud-specific (AWS, GCP, Azure, LibVirt) block device names (e.g. /dev/sdf) with the volume provided to the OS. #license: #- BSD-3-Clause license_file: 'LICENSE' -tags: ['aws', 'gcp', 'azure', 'storage', 'system'] +tags: ['aws', 'gcp', 'azure', 'libvirt', 'storage', 'system'] dependencies: {} diff --git a/jenkinsfiles/Jenkinsfile_release_tag b/jenkinsfiles/Jenkinsfile_release_tag index 3637542..726e3a9 100644 --- a/jenkinsfiles/Jenkinsfile_release_tag +++ b/jenkinsfiles/Jenkinsfile_release_tag @@ -5,7 +5,7 @@ def PROJECT_URL_DEFAULT = "https://github.com/dseeley/blockdevmap" def PROJECT_BRANCH_DEFAULT = "master" //Set the default git branch to use if we're not running an SCM job (e.g. if we're copying/pasting into a pipeline script) def pypi_ansible = ["curl", "-s", "-H", "Accept: application/json", "-H", "Content-type: application/json", "GET", "https://pypi.org/pypi/ansible/json"].execute().text -def pypi_ansible_latest = new groovy.json.JsonSlurper().parseText(pypi_ansible).releases.keySet()[-1] +def pypi_ansible_latest = new groovy.json.JsonSlurper().parseText(pypi_ansible).info.version // Use `info.version` instead of `.releases.keySet()[-1]`, to avoid alpha and release candidate versions //This allows us to create our own Docker image for this specific use-case. Once it is built, it will not be rebuilt, so only adds delay the first time we use it. def create_custom_image(image_name, build_opts = "") { diff --git a/jenkinsfiles/Jenkinsfile_release_tag__auto b/jenkinsfiles/Jenkinsfile_release_tag__auto index 5e1a8e9..1c70ebd 100644 --- a/jenkinsfiles/Jenkinsfile_release_tag__auto +++ b/jenkinsfiles/Jenkinsfile_release_tag__auto @@ -1,7 +1,7 @@ #!groovy def pypi_ansible = ["curl", "-s", "-H", "Accept: application/json", "-H", "Content-type: application/json", "GET", "https://pypi.org/pypi/ansible/json"].execute().text -def pypi_ansible_latest = new groovy.json.JsonSlurper().parseText(pypi_ansible).releases.keySet()[-1] +def pypi_ansible_latest = new groovy.json.JsonSlurper().parseText(pypi_ansible).info.version // Use `info.version` instead of `.releases.keySet()[-1]`, to avoid alpha and release candidate versions node { stage('Call ansible/blockdevmap-release-tag') { diff --git a/plugins/modules/blockdevmap.py b/plugins/modules/blockdevmap.py index 7624be6..5af89f1 100644 --- a/plugins/modules/blockdevmap.py +++ b/plugins/modules/blockdevmap.py @@ -31,13 +31,13 @@ - name: Get block device map information for cloud provider blockdevmap: cloud_type: - become: yes + become: true register: r__blockdevmap - name: Get lsblk device map information blockdevmap: cloud_type: lsblk - become: yes + become: true register: r__blockdevmap - name: debug blockdevmap