File tree Expand file tree Collapse file tree 13 files changed +257
-39
lines changed Expand file tree Collapse file tree 13 files changed +257
-39
lines changed Original file line number Diff line number Diff line change 1+ warn_list:
2+ - '208'
3+ - '301'
4+ skip_list:
5+ - '106' # Role name {} does not match ``^[a-z][a-z0-9_]+$`` pattern
Original file line number Diff line number Diff line change 1+ ---
2+ # This is a basic workflow to help you get started with Actions
3+ name : Molecule
4+
5+ # Controls when the action will run. Triggers the workflow on push or pull request
6+ # events but only for the master branch
7+ on :
8+ push :
9+ pull_request :
10+ branches :
11+ - master
12+ - tags/*
13+
14+ # A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+ jobs :
16+ # This workflow contains a single job called "build"
17+ lint :
18+ # The type of runner that the job will run on
19+ runs-on : ubuntu-latest
20+
21+ # Steps represent a sequence of tasks that will be executed as part of the job
22+ steps :
23+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
24+ - uses : actions/checkout@v2
25+
26+ - name : install lint prerequisite
27+ run : |
28+ sudo apt-get update
29+ sudo apt -y install python3-setuptools ansible-lint vagrant
30+
31+ - name : Install molecule
32+ run : |
33+ sudo apt update
34+ sudo apt -y install python3-setuptools python3 python3-pip
35+ sudo pip3 install wheel
36+ sudo pip3 install molecule testinfra yamllint ansible-lint flake8 molecule-vagrant
37+
38+ - name : molecule lint
39+ run : |
40+ molecule lint
41+
42+ requirements :
43+ # The type of runner that the job will run on
44+ runs-on : ubuntu-latest
45+ # Steps represent a sequence of tasks that will be executed as part of the job
46+ steps :
47+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
48+ - uses : actions/checkout@v2
49+ - name : install prereq
50+ run : |
51+ ansible-galaxy role install -r requirements.yml
Original file line number Diff line number Diff line change 1+ ** /__pychache__
Original file line number Diff line number Diff line change 11---
2- language : python
3- python : " 2.7"
42
5- # Use the new container infrastructure
6- sudo : false
3+ dist : bionic
74
8- # Install ansible
5+ language : python
96addons :
107 apt :
8+ sources :
9+ - sourceline : ' deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main'
10+ key_url : ' https://apt.releases.hashicorp.com/gpg'
11+ update : true
1112 packages :
12- - python-pip
13+ - bridge-utils
14+ - dnsmasq-base
15+ - ebtables
16+ - libvirt-bin
17+ - libvirt-dev
18+ - qemu-kvm
19+ - qemu-utils
20+ - ruby-dev
21+ - ca-certificates
22+ - curl
23+ - gcc
24+ - iproute2
25+ - sudo
26+ - vagrant
27+ python :
28+ - " 3.8"
1329
1430install :
15- # Install ansible
31+ # - wget https://releases.hashicorp.com/vagrant/$VAGRANT_VER/vagrant_"$VAGRANT_VER"_x86_64.deb
32+ # - sudo apt -y install ./vagrant_"$VAGRANT_VER"_x86_64.deb
33+ - vagrant plugin install vagrant-libvirt
34+ - pip install wheel pyopenssl
35+ - pip install netaddr python-vagrant yamllint testinfra flake8
1636 - pip install ansible ansible-lint
37+ - pip install molecule molecule-vagrant python-vagrant
38+ - sudo chmod o+rwx /var/run/libvirt/libvirt-sock
1739
18- # Check ansible version
19- - ansible --version
20-
21- # Create ansible.cfg with correct roles_path
22- - printf '[defaults]\nroles_path=../' >ansible.cfg
23-
24- # Compensate for repo name being different to the role
25- - ln -s $(pwd) ../stackhpc.libvirt-host
26-
27- script :
28- # Run Ansible lint against the role
29- - ansible-lint tasks/main.yml
30-
31- # Basic role syntax check
32- - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
33-
34- notifications :
35- webhooks : https://galaxy.ansible.com/api/v1/notifications/
40+ script : travis_wait 30 molecule test --scenario-name kvm
41+ branches :
42+ only :
43+ - master
Original file line number Diff line number Diff line change 1+ ---
2+ # Based on ansible-lint config
3+ extends: default
4+
5+ rules:
6+ braces:
7+ max-spaces-inside: 1
8+ level: error
9+ brackets:
10+ max-spaces-inside: 1
11+ level: error
12+ colons:
13+ max-spaces-after: -1
14+ level: error
15+ commas:
16+ max-spaces-after: -1
17+ level: error
18+ comments: disable
19+ comments-indentation: disable
20+ document-start: disable
21+ empty-lines:
22+ max: 3
23+ level: error
24+ hyphens:
25+ level: error
26+ indentation: disable
27+ key-duplicates: enable
28+ line-length: disable
29+ new-line-at-end-of-file: disable
30+ new-lines:
31+ type: unix
32+ trailing-spaces: disable
33+ truthy: disable
Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ storage pools.
193193Dependencies
194194------------
195195
196- None
196+ * [ The LVM role ] ( https://github.com/mrlesmithjr/ansible-manage-lvm ) You can install it using ` ansible-galaxy install -r requirements.yml --roles-p ../community `
197197
198198Example Playbook
199199----------------
@@ -203,6 +203,11 @@ Example Playbook
203203 hosts: all
204204 roles:
205205 - role: stackhpc.libvirt-host
206+ lvm_groups: # see according properties on [The LVM role](https://github.com/mrlesmithjr/ansible-manage-lvm)
207+ - vgname: libvirtvg
208+ disks:
209+ - /dev/sdb1
210+ create: true
206211 libvirt_host_pools:
207212 - name: my-pool
208213 type: dir
@@ -212,11 +217,8 @@ Example Playbook
212217 owner: my-user
213218 group: my-group
214219 - name: lvm_pool
215- type: logical
216- source: vg1
217- target: /dev/vg1
218- pvs:
219- - /dev/sda3
220+ type: lvm2
221+ source: libvirtvg
220222 - name: rbd-pool
221223 type: rbd
222224 source: rbd
Original file line number Diff line number Diff line change 1+ ../default/ Vagrantfile
Original file line number Diff line number Diff line change 1+ ---
2+ - name : Converge
3+ hosts : all
4+ vars :
5+ manage_lvm : true
6+ lvm_groups :
7+ - vgname : libvirt_vg
8+ disks :
9+ - /dev/vdb
10+ create : true
11+ users_group_list :
12+ - name : libvirt
13+ systemusers_user_list :
14+ - name : libvirt
15+ group : libvirt
16+ groups : wheel
17+ libvirt_host_pools :
18+ - name : libvirtpool
19+ type : lvm2
20+ source : libvirt_vg
21+ libvirt_host_networks :
22+ - name : ansible-virtualization-bridge
23+ mode : bridge
24+ bridge : bridge0
25+ tasks :
26+ - name : " Include ansible-role-libvirt-host"
27+ include_role :
28+ name : " ansible-role-libvirt-host"
29+
30+ - name : " Post converge - Install vagrant"
31+ package :
32+ name :
33+ - qemu
34+ - ruby-devel
35+ - gcc
36+ - qemu-kvm
37+ - libxml2-devel
38+ - libxslt-devel
39+ - libguestfs-tools-c
40+ - vagrant
41+ - daemonize
42+ state : present
43+ become : true
44+
45+ - name : Copy vagrant file
46+ copy :
47+ src : Vagrantfile
48+ dest : /home/vagrant/Vagrantfile
49+ owner : vagrant
50+ group : vagrant
51+ mode : ' 0644'
52+
53+ - name : Execute Vagrant as daemon
54+ command :
55+ cmd : " daemonize -e /home/vagrant/myvmerr.log -o /home/vagrant/myvm.log -c /home/vagrant /usr/bin/vagrant up --provider=libvirt"
56+ chdir : /home/vagrant
57+ creates : /home/vagrant/myvm.log
58+
59+ - name : Wait until the string "auth" is in the vagrant log
60+ wait_for :
61+ path : /home/vagrant/myvmerr.log
62+ search_regex : SSH\sis\sready
63+ timeout : 1000
Original file line number Diff line number Diff line change 1+ ---
2+ dependency :
3+ name : galaxy
4+ options :
5+ role-file : requirements.yml
6+ roles-path : ../community
7+ driver :
8+ name : vagrant
9+ provider :
10+ name : libvirt
11+ lint : yamllint . && flake8 && ansible-lint --exclude=meta
12+ platforms :
13+ - name : Fedora-Molecule-libvirt-host
14+ box : fedora/33-cloud-base
15+ provider_options :
16+ driver : ' "kvm"'
17+ cpus : 2
18+ memory : 2048
19+ provider_raw_config_args :
20+ - " storage :file, :size => '1G', :device => 'vdb'"
21+ provisioner :
22+ name : ansible
23+ config_options :
24+ defaults :
25+ forks : 20
26+ ssh_connection :
27+ pipelining : true
28+ ssh_args : -o ControlMaster=auto -o ControlPersist=600s
29+ env :
30+ ANSIBLE_ROLES_PATH : ../../..:../../../community
31+ verifier :
32+ name : testinfra
33+ env :
34+ PYTHONWARNINGS : " ignore:.*U.*mode is deprecated:DeprecationWarning"
35+ options :
36+ v : 1
37+ scenario :
38+ name : kvm
Original file line number Diff line number Diff line change 1+ ../default/tests
You can’t perform that action at this time.
0 commit comments