From 579552d9936678ccda138c46b133382ccafefbce Mon Sep 17 00:00:00 2001 From: Robert Wimmer <2039811+githubixx@users.noreply.github.com> Date: Tue, 13 Sep 2022 23:44:16 +0200 Subject: [PATCH] 0.3.0 (#4) * min_ansible_version variable value should be string / versions should be string in meta/main.yml * use FQN Ansible module names / fix Jinja2 spacing * update (c) year * add Github release action to push new release to Ansible Galaxy * update CHANGELOG * molecule: add prepare.yml * molecule: add vars/test-lvm-minimal.yml with some minimal LVM variables enough to test core functionality * remove support for Fedora 33 + 34 / add support for Fedora 35 + 36 / remove support for opensuse 15.2 / add support for opensuse 15.3 / add support for Ubuntu 22.04 * remove opensuse 15.4 from meta/main.yml * tasks/main.yml: use fully qualified Ansible module names * update kvm Molecule test scenario * rename kvm-debian-20-only -> kvm-ubuntu-20-only * update Molecule scenario kvm-lvm-mirror * update Molecule scenario kvm-ubuntu-20-only * update CHANGELOG --- .github/workflows/release.yml | 42 ++++++++++ CHANGELOG.md | 16 ++++ README.md | 2 +- defaults/main.yml | 2 +- meta/main.yml | 23 +++--- molecule/kvm-lvm-mirror/converge.yml | 4 +- molecule/kvm-lvm-mirror/molecule.yml | 9 +- .../vars/test-lvm-ubuntu2004_create.yml | 2 +- .../converge.yml | 4 +- .../molecule.yml | 11 ++- .../vars/test-lvm-ubuntu2004_create.yml | 2 +- .../vars/test-lvm-ubuntu2004_delete.yml | 2 +- molecule/kvm/converge.yml | 62 +++++++------- molecule/kvm/molecule.yml | 82 ++++++++++++++----- molecule/kvm/prepare.yml | 29 +++++++ molecule/kvm/vars/test-lvm-arch_create.yml | 2 +- molecule/kvm/vars/test-lvm-arch_delete.yml | 2 +- molecule/kvm/vars/test-lvm-minimal.yml | 30 +++++++ .../kvm/vars/test-lvm-ubuntu2004_create.yml | 2 +- tasks/delete_fs.yml | 2 +- tasks/delete_lvs.yml | 2 +- tasks/delete_vgs.yml | 2 +- tasks/ensure_fs.yml | 2 +- tasks/ensure_lvs.yml | 2 +- tasks/ensure_vgs.yml | 2 +- tasks/main.yml | 30 +++---- tasks/mounts.yml | 2 +- tasks/setup-archlinux.yml | 2 +- tasks/setup-debian.yml | 2 +- tasks/setup-redhat.yml | 2 +- tasks/setup-suse.yml | 2 +- 31 files changed, 271 insertions(+), 109 deletions(-) create mode 100644 .github/workflows/release.yml rename molecule/{kvm-debian-20-only => kvm-ubuntu-20-only}/converge.yml (85%) rename molecule/{kvm-debian-20-only => kvm-ubuntu-20-only}/molecule.yml (88%) rename molecule/{kvm-debian-20-only => kvm-ubuntu-20-only}/vars/test-lvm-ubuntu2004_create.yml (94%) rename molecule/{kvm-debian-20-only => kvm-ubuntu-20-only}/vars/test-lvm-ubuntu2004_delete.yml (95%) create mode 100644 molecule/kvm/prepare.yml create mode 100644 molecule/kvm/vars/test-lvm-minimal.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..65171a0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +--- +# Copyright (C) 2021-2022 Robert Wimmer +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This workflow requires a GALAXY_API_KEY secret present in the GitHub +# repository or organization. +# +# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy +# See: https://github.com/ansible/galaxy/issues/46 + +name: Release +on: + push: + tags: + - '*' + +defaults: + run: + working-directory: 'githubixx.lvm' + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Check out the codebase. + uses: actions/checkout@v2 + with: + path: 'githubixx.lvm' + + - name: Set up Python 3. + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install Ansible. + run: pip3 install ansible-core + + - name: Trigger a new import on Galaxy. + run: >- + ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} + $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41a8ef2..3db0050 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,22 @@ Changelog --------- +**0.3.0** + +- fix various `ansible-lint` issues +- update Molecule scenario `kvm-ubuntu-20-only` +- update Molecule scenario `kvm-lvm-mirror` +- update Molecule scenario `kvm` +- `tasks/main.yml`: use fully qualified Ansible module names +- remove support for Fedora 33 + 34 +- add support for Fedora 35 + 36 +- remove support for opensuse 15.2 +- add support for opensuse 15.3 +- add support for Ubuntu 22.04 +- molecule: add `vars/test-lvm-minimal.yml` with some minimal LVM variables enough to test core functionality +- add Github release action to push new release to Ansible Galaxy +- `min_ansible_version` variable value should be string / versions should be string in `meta/main.yml` + **0.2.0** - fix error when creating only a volume group without a logical volume diff --git a/README.md b/README.md index 769dab7..b1913aa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ diff --git a/defaults/main.yml b/defaults/main.yml index 1a4d116..02cba0f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later # By default no LVM resources are created. See examples below. diff --git a/meta/main.yml b/meta/main.yml index 66d0737..daa5915 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,35 +1,36 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later galaxy_info: author: Robert Wimmer description: Manage Linux Logical Volume Manager resources license: GPLv3 - min_ansible_version: 2.9 + min_ansible_version: "2.9" role_name: lvm namespace: githubixx platforms: - name: ArchLinux - name: Ubuntu versions: - - bionic - - focal + - "bionic" + - "focal" + - "jammy" - name: Debian versions: - - buster - - bullseye + - "buster" + - "bullseye" - name: EL versions: - - 7 - - 8 + - "7" + - "8" - name: Fedora versions: - - 33 - - 34 + - "35" + - "36" - name: opensuse versions: - - 15.2 + - "15.3" galaxy_tags: - linux - lvm diff --git a/molecule/kvm-lvm-mirror/converge.yml b/molecule/kvm-lvm-mirror/converge.yml index 5e61af5..09b81f4 100644 --- a/molecule/kvm-lvm-mirror/converge.yml +++ b/molecule/kvm-lvm-mirror/converge.yml @@ -1,10 +1,10 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - hosts: test-lvm-ubuntu2004 vars_files: - - vars/test-lvm-ubuntu2004_create.yml + - vars/test-lvm-ubuntu2004_create.yml remote_user: vagrant become: true gather_facts: true diff --git a/molecule/kvm-lvm-mirror/molecule.yml b/molecule/kvm-lvm-mirror/molecule.yml index 81c4b58..95b23ca 100644 --- a/molecule/kvm-lvm-mirror/molecule.yml +++ b/molecule/kvm-lvm-mirror/molecule.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later dependency: @@ -10,13 +10,12 @@ driver: provider: name: libvirt type: libvirt - options: - memory: 192 - cpus: 2 platforms: - name: test-lvm-ubuntu2004 box: generic/ubuntu2004 + memory: 1024 + cpus: 2 provider_raw_config_args: - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" - "storage :file, :type => 'qcow2', :device => 'vdc', :size => '1G'" @@ -42,4 +41,4 @@ scenario: verifier: name: ansible - enabled: False + enabled: false diff --git a/molecule/kvm-lvm-mirror/vars/test-lvm-ubuntu2004_create.yml b/molecule/kvm-lvm-mirror/vars/test-lvm-ubuntu2004_create.yml index b4df8ca..20bd3b6 100644 --- a/molecule/kvm-lvm-mirror/vars/test-lvm-ubuntu2004_create.yml +++ b/molecule/kvm-lvm-mirror/vars/test-lvm-ubuntu2004_create.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later lvm_vgs: diff --git a/molecule/kvm-debian-20-only/converge.yml b/molecule/kvm-ubuntu-20-only/converge.yml similarity index 85% rename from molecule/kvm-debian-20-only/converge.yml rename to molecule/kvm-ubuntu-20-only/converge.yml index a0b26b2..fc2c917 100644 --- a/molecule/kvm-debian-20-only/converge.yml +++ b/molecule/kvm-ubuntu-20-only/converge.yml @@ -1,10 +1,10 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - hosts: test-lvm-ubuntu2004 vars_files: - - vars/test-lvm-ubuntu2004_create.yml + - vars/test-lvm-ubuntu2004_create.yml remote_user: vagrant become: true gather_facts: true diff --git a/molecule/kvm-debian-20-only/molecule.yml b/molecule/kvm-ubuntu-20-only/molecule.yml similarity index 88% rename from molecule/kvm-debian-20-only/molecule.yml rename to molecule/kvm-ubuntu-20-only/molecule.yml index c998f04..e7f7ccd 100644 --- a/molecule/kvm-debian-20-only/molecule.yml +++ b/molecule/kvm-ubuntu-20-only/molecule.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later dependency: @@ -10,13 +10,12 @@ driver: provider: name: libvirt type: libvirt - options: - memory: 192 - cpus: 2 platforms: - name: test-lvm-ubuntu2004 box: generic/ubuntu2004 + memory: 1024 + cpus: 2 provider_raw_config_args: - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" - "storage :file, :type => 'qcow2', :device => 'vdc', :size => '1G'" @@ -37,11 +36,11 @@ provisioner: lint: yamllint . && flake8 && ansible-lint scenario: - name: kvm-vg-only + name: kvm-ubuntu-20-only test_sequence: - prepare - converge verifier: name: ansible - enabled: False + enabled: false diff --git a/molecule/kvm-debian-20-only/vars/test-lvm-ubuntu2004_create.yml b/molecule/kvm-ubuntu-20-only/vars/test-lvm-ubuntu2004_create.yml similarity index 94% rename from molecule/kvm-debian-20-only/vars/test-lvm-ubuntu2004_create.yml rename to molecule/kvm-ubuntu-20-only/vars/test-lvm-ubuntu2004_create.yml index 053c6c0..02fe2bc 100644 --- a/molecule/kvm-debian-20-only/vars/test-lvm-ubuntu2004_create.yml +++ b/molecule/kvm-ubuntu-20-only/vars/test-lvm-ubuntu2004_create.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later lvm_vgs: diff --git a/molecule/kvm-debian-20-only/vars/test-lvm-ubuntu2004_delete.yml b/molecule/kvm-ubuntu-20-only/vars/test-lvm-ubuntu2004_delete.yml similarity index 95% rename from molecule/kvm-debian-20-only/vars/test-lvm-ubuntu2004_delete.yml rename to molecule/kvm-ubuntu-20-only/vars/test-lvm-ubuntu2004_delete.yml index b85be21..8adf866 100644 --- a/molecule/kvm-debian-20-only/vars/test-lvm-ubuntu2004_delete.yml +++ b/molecule/kvm-ubuntu-20-only/vars/test-lvm-ubuntu2004_delete.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later lvm_vgs: diff --git a/molecule/kvm/converge.yml b/molecule/kvm/converge.yml index 33627c3..df66159 100644 --- a/molecule/kvm/converge.yml +++ b/molecule/kvm/converge.yml @@ -1,35 +1,21 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later -- hosts: all +- hosts: test-lvm-ubuntu2204 + vars_files: + - vars/test-lvm-minimal.yml remote_user: vagrant become: true gather_facts: true tasks: - - block: - - name: (Archlinux) Init pacman - raw: | - pacman-key --init - pacman-key --populate archlinux - changed_when: false - ignore_errors: true - - - name: (Archlinux) Update pacman cache - community.general.pacman: - update_cache: yes - changed_when: false - when: ansible_distribution|lower == 'archlinux' - - - name: (Ubuntu) Update APT package cache - apt: - update_cache: "true" - cache_valid_time: 3600 - when: ansible_distribution|lower == 'ubuntu' + - name: Include LVM role + include_role: + name: githubixx.lvm - hosts: test-lvm-ubuntu2004 vars_files: - - vars/test-lvm-ubuntu2004_create.yml + - vars/test-lvm-ubuntu2004_create.yml remote_user: vagrant become: true gather_facts: true @@ -39,6 +25,8 @@ name: githubixx.lvm - hosts: test-lvm-ubuntu1804 + vars_files: + - vars/test-lvm-minimal.yml remote_user: vagrant become: true gather_facts: true @@ -48,6 +36,8 @@ name: githubixx.lvm - hosts: test-lvm-debian10 + vars_files: + - vars/test-lvm-minimal.yml remote_user: vagrant become: true gather_facts: true @@ -56,7 +46,9 @@ include_role: name: githubixx.lvm -- hosts: test-lvm-fedora33 +- hosts: test-lvm-fedora35 + vars_files: + - vars/test-lvm-minimal.yml remote_user: vagrant become: true gather_facts: true @@ -65,7 +57,9 @@ include_role: name: githubixx.lvm -- hosts: test-lvm-fedora34 +- hosts: test-lvm-fedora36 + vars_files: + - vars/test-lvm-minimal.yml remote_user: vagrant become: true gather_facts: true @@ -74,7 +68,9 @@ include_role: name: githubixx.lvm -- hosts: test-lvm-centos8 +- hosts: test-lvm-centos7 + vars_files: + - vars/test-lvm-minimal.yml remote_user: vagrant become: true gather_facts: true @@ -83,7 +79,9 @@ include_role: name: githubixx.lvm -- hosts: test-lvm-centos7 +- hosts: test-lvm-arch + vars_files: + - vars/test-lvm-arch_create.yml remote_user: vagrant become: true gather_facts: true @@ -94,7 +92,7 @@ - hosts: test-lvm-arch vars_files: - - vars/test-lvm-arch_create.yml + - vars/test-lvm-arch_delete.yml remote_user: vagrant become: true gather_facts: true @@ -103,9 +101,9 @@ include_role: name: githubixx.lvm -- hosts: test-lvm-arch +- hosts: test-lvm-opensuse-leap-15-3 vars_files: - - vars/test-lvm-arch_delete.yml + - vars/test-lvm-minimal.yml remote_user: vagrant become: true gather_facts: true @@ -114,7 +112,9 @@ include_role: name: githubixx.lvm -- hosts: test-lvm-opensuse-leap +- hosts: test-lvm-opensuse-leap-15-4 + vars_files: + - vars/test-lvm-minimal.yml remote_user: vagrant become: true gather_facts: true @@ -124,6 +124,8 @@ name: githubixx.lvm - hosts: test-lvm-debian11 + vars_files: + - vars/test-lvm-minimal.yml remote_user: vagrant become: true gather_facts: true diff --git a/molecule/kvm/molecule.yml b/molecule/kvm/molecule.yml index cfce29c..6f9c488 100644 --- a/molecule/kvm/molecule.yml +++ b/molecule/kvm/molecule.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later dependency: @@ -10,13 +10,12 @@ driver: provider: name: libvirt type: libvirt - options: - memory: 192 - cpus: 2 platforms: - - name: test-lvm-ubuntu2004 - box: generic/ubuntu2004 + - name: test-lvm-ubuntu2204 + box: generic/ubuntu2204 + memory: 1024 + cpus: 2 provider_raw_config_args: - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" interfaces: @@ -24,36 +23,56 @@ platforms: network_name: private_network type: static ip: 192.168.10.10 - - name: test-lvm-ubuntu1804 - box: generic/ubuntu1804 + - name: test-lvm-ubuntu2004 + box: generic/ubuntu2004 + memory: 1024 + cpus: 2 + provider_raw_config_args: + - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" interfaces: - auto_config: true network_name: private_network type: static ip: 192.168.10.20 - - name: test-lvm-debian10 - box: generic/debian10 + - name: test-lvm-ubuntu1804 + box: generic/ubuntu1804 + memory: 1024 + cpus: 2 + provider_raw_config_args: + - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" interfaces: - auto_config: true network_name: private_network type: static ip: 192.168.10.30 - - name: test-lvm-fedora33 - box: generic/fedora33 + - name: test-lvm-debian10 + box: generic/debian10 + memory: 1024 + cpus: 2 + provider_raw_config_args: + - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" interfaces: - auto_config: true network_name: private_network type: static ip: 192.168.10.40 - - name: test-lvm-fedora34 - box: generic/fedora34 + - name: test-lvm-fedora35 + box: generic/fedora35 + memory: 1024 + cpus: 2 + provider_raw_config_args: + - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" interfaces: - auto_config: true network_name: private_network type: static ip: 192.168.10.50 - - name: test-lvm-centos8 - box: generic/centos8 + - name: test-lvm-fedora36 + box: generic/fedora36 + memory: 1024 + cpus: 2 + provider_raw_config_args: + - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" interfaces: - auto_config: true network_name: private_network @@ -61,6 +80,10 @@ platforms: ip: 192.168.10.60 - name: test-lvm-centos7 box: generic/centos7 + memory: 1024 + cpus: 2 + provider_raw_config_args: + - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" interfaces: - auto_config: true network_name: private_network @@ -68,6 +91,8 @@ platforms: ip: 192.168.10.70 - name: test-lvm-arch box: archlinux/archlinux + memory: 1024 + cpus: 2 provider_raw_config_args: - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" - "storage :file, :type => 'qcow2', :device => 'vdc', :size => '1G'" @@ -76,15 +101,34 @@ platforms: network_name: private_network type: static ip: 192.168.10.80 - - name: test-lvm-opensuse-leap - box: opensuse/Leap-15.2.x86_64 + - name: test-lvm-opensuse-leap-15-3 + box: opensuse/Leap-15.3.x86_64 + memory: 1024 + cpus: 2 + provider_raw_config_args: + - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" interfaces: - auto_config: true network_name: private_network type: static ip: 192.168.10.90 + - name: test-lvm-opensuse-leap-15-4 + box: opensuse/Leap-15.4.x86_64 + memory: 1024 + cpus: 2 + provider_raw_config_args: + - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" + interfaces: + - auto_config: true + network_name: private_network + type: static + ip: 192.168.10.100 - name: test-lvm-debian11 box: generic/debian11 + memory: 1024 + cpus: 2 + provider_raw_config_args: + - "storage :file, :type => 'qcow2', :device => 'vdb', :size => '1G'" interfaces: - auto_config: true network_name: private_network @@ -107,4 +151,4 @@ scenario: verifier: name: ansible - enabled: False + enabled: false diff --git a/molecule/kvm/prepare.yml b/molecule/kvm/prepare.yml new file mode 100644 index 0000000..6a0e08c --- /dev/null +++ b/molecule/kvm/prepare.yml @@ -0,0 +1,29 @@ +--- +# Copyright (C) 2021-2022 Robert Wimmer +# SPDX-License-Identifier: GPL-3.0-or-later + +- hosts: all + remote_user: vagrant + become: true + gather_facts: true + tasks: + - name: (Archlinux) setup + block: + - name: (Archlinux) Init pacman + raw: | + pacman-key --init + pacman-key --populate archlinux + changed_when: false + ignore_errors: true + + - name: (Archlinux) Update pacman cache + community.general.pacman: + update_cache: true + changed_when: false + when: ansible_distribution | lower == 'archlinux' + + - name: (Ubuntu) Update APT package cache + apt: + update_cache: true + cache_valid_time: 3600 + when: ansible_distribution | lower == 'ubuntu' diff --git a/molecule/kvm/vars/test-lvm-arch_create.yml b/molecule/kvm/vars/test-lvm-arch_create.yml index f209533..90a123c 100644 --- a/molecule/kvm/vars/test-lvm-arch_create.yml +++ b/molecule/kvm/vars/test-lvm-arch_create.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later lvm_vgs: diff --git a/molecule/kvm/vars/test-lvm-arch_delete.yml b/molecule/kvm/vars/test-lvm-arch_delete.yml index cf1522a..48489a2 100644 --- a/molecule/kvm/vars/test-lvm-arch_delete.yml +++ b/molecule/kvm/vars/test-lvm-arch_delete.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later lvm_vgs: diff --git a/molecule/kvm/vars/test-lvm-minimal.yml b/molecule/kvm/vars/test-lvm-minimal.yml new file mode 100644 index 0000000..aaa6542 --- /dev/null +++ b/molecule/kvm/vars/test-lvm-minimal.yml @@ -0,0 +1,30 @@ +--- +# Copyright (C) 2021-2022 Robert Wimmer +# SPDX-License-Identifier: GPL-3.0-or-later + +lvm_vgs: + - vgname: vg01 + pvs: /dev/vdb + pesize: 2M + state: present + lvm_lvs: + - lvname: vg01lv01 + size: 10%VG + state: present + fs: + type: ext4 + state: present + mountpoint: + state: mounted + path: + name: /vg01lv01 + - lvname: vg01lv02 + size: 10%VG + state: present + fs: + type: ext4 + state: present + mountpoint: + state: mounted + path: + name: /vg01lv02 diff --git a/molecule/kvm/vars/test-lvm-ubuntu2004_create.yml b/molecule/kvm/vars/test-lvm-ubuntu2004_create.yml index 287a28f..ef66451 100644 --- a/molecule/kvm/vars/test-lvm-ubuntu2004_create.yml +++ b/molecule/kvm/vars/test-lvm-ubuntu2004_create.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later lvm_vgs: diff --git a/tasks/delete_fs.yml b/tasks/delete_fs.yml index 6d295b9..7bc4d10 100644 --- a/tasks/delete_fs.yml +++ b/tasks/delete_fs.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - name: Delete filesystems marked for deletion diff --git a/tasks/delete_lvs.yml b/tasks/delete_lvs.yml index 569e938..ca376ce 100644 --- a/tasks/delete_lvs.yml +++ b/tasks/delete_lvs.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - name: Delete logical volumes marked for deletion diff --git a/tasks/delete_vgs.yml b/tasks/delete_vgs.yml index d862910..86d8c3d 100644 --- a/tasks/delete_vgs.yml +++ b/tasks/delete_vgs.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - name: Delete volume group(s) marked for deletion diff --git a/tasks/ensure_fs.yml b/tasks/ensure_fs.yml index ccb7410..3c5148f 100644 --- a/tasks/ensure_fs.yml +++ b/tasks/ensure_fs.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - name: Ensure filesystems diff --git a/tasks/ensure_lvs.yml b/tasks/ensure_lvs.yml index 2d36c0d..2dcd3c5 100644 --- a/tasks/ensure_lvs.yml +++ b/tasks/ensure_lvs.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - name: Ensure logical volumes diff --git a/tasks/ensure_vgs.yml b/tasks/ensure_vgs.yml index 411748d..7821d2a 100644 --- a/tasks/ensure_vgs.yml +++ b/tasks/ensure_vgs.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - name: Ensure volume group(s) diff --git a/tasks/main.yml b/tasks/main.yml index 0ec0e12..f353738 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,69 +1,69 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - name: Gather instance facts - setup: + ansible.builtin.setup: - name: Execute OS specific tasks - include_tasks: + ansible.builtin.include_tasks: file: "{{ item }}" apply: tags: - lvm-install with_first_found: - - "setup-{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version }}.yml" - - "setup-{{ ansible_distribution|lower }}-{{ ansible_distribution_version }}.yml" - - "setup-{{ ansible_distribution|lower }}-{{ ansible_distribution_release }}.yml" - - "setup-{{ ansible_distribution|lower }}.yml" - - "setup-{{ ansible_os_family|lower }}.yml" + - "setup-{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version }}.yml" + - "setup-{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}.yml" + - "setup-{{ ansible_distribution | lower }}-{{ ansible_distribution_release }}.yml" + - "setup-{{ ansible_distribution | lower }}.yml" + - "setup-{{ ansible_os_family | lower }}.yml" tags: - lvm-install - name: Ensure volume groups - include_tasks: + ansible.builtin.include_tasks: file: ensure_vgs.yml apply: tags: - lvm-ensure-volume-groups - name: Ensure logical volumes - include_tasks: + ansible.builtin.include_tasks: file: ensure_lvs.yml apply: tags: - lvm-ensure-logical-volumes - name: Ensure filesystems - include_tasks: + ansible.builtin.include_tasks: file: ensure_fs.yml apply: tags: - lvm-ensure-filesystems - name: Handle mountpoints - include_tasks: + ansible.builtin.include_tasks: file: mounts.yml apply: tags: - lvm-mounts - name: Delete filesystems - include_tasks: + ansible.builtin.include_tasks: file: delete_fs.yml apply: tags: - lvm-delete-filesystems - name: Delete logical volumes - include_tasks: + ansible.builtin.include_tasks: file: delete_lvs.yml apply: tags: - lvm-delete-logical-volumes - name: Delete volume groups - include_tasks: + ansible.builtin.include_tasks: file: delete_vgs.yml apply: tags: diff --git a/tasks/mounts.yml b/tasks/mounts.yml index a99085a..c6cd1da 100644 --- a/tasks/mounts.yml +++ b/tasks/mounts.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - name: Tasks for handling mountpoints diff --git a/tasks/setup-archlinux.yml b/tasks/setup-archlinux.yml index 70d1a19..efe5f24 100644 --- a/tasks/setup-archlinux.yml +++ b/tasks/setup-archlinux.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - name: (Archlinux compatible OS) Install required packages diff --git a/tasks/setup-debian.yml b/tasks/setup-debian.yml index f0279f6..0c67da1 100644 --- a/tasks/setup-debian.yml +++ b/tasks/setup-debian.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - name: (Debian compatible OS) Install required packages diff --git a/tasks/setup-redhat.yml b/tasks/setup-redhat.yml index 314c977..45457c3 100644 --- a/tasks/setup-redhat.yml +++ b/tasks/setup-redhat.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - name: (RedHat compatible OS) Install required packages diff --git a/tasks/setup-suse.yml b/tasks/setup-suse.yml index 82c7959..3f2de49 100644 --- a/tasks/setup-suse.yml +++ b/tasks/setup-suse.yml @@ -1,5 +1,5 @@ --- -# Copyright (C) 2021 Robert Wimmer +# Copyright (C) 2021-2022 Robert Wimmer # SPDX-License-Identifier: GPL-3.0-or-later - name: (SuSE compatible OS) Install required packages