Skip to content

Commit

Permalink
Merge pull request #69 from voxpupuli/libvirt
Browse files Browse the repository at this point in the history
ci01: Install libvirt
  • Loading branch information
bastelfreak authored Sep 19, 2024
2 parents b965606 + 41407c5 commit ca175be
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 4 deletions.
1 change: 1 addition & 0 deletions Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ mod 'saz/sudo', '8.0.0'
mod 'puppet/github_actions_runner', '1.1.0'
mod 'puppet/nftables', '4.0.0'
mod 'puppetlabs/docker', '10.0.1'
mod 'cirrax/libvirt', '5.0.4'
1 change: 1 addition & 0 deletions data/nodes/ci01.voxpupu.li.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
profiles::base::manage_borg: false
profiles::github_runners::setup_ruby: true
profiles::github_runners::setup_docker: true
profiles::github_runners::setup_libvirt: true
profiles::github_runners::instances: ['first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'senventh', 'eighth', 'ninth', 'tenth', 'eleventh', 'twelfth', 'thirteenth', 'fourteenth', 'fifteenth', 'sixteenth']
profiles::github_runners::runner_group: 'Macarne-runners'
profiles::github_runners::labels: ['self-hosted', 'macarne']
Expand Down
3 changes: 2 additions & 1 deletion site/profiles/.fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ fixtures:
puppet: https://github.com/theforeman/puppet-puppet
extlib: https://github.com/voxpupuli/puppet-extlib.git
nftables: https://github.com/voxpupuli/puppet-nftables.git
docker: https://github.com/puppetlabs/puppetlabs-docker
docker: git://github.com/puppetlabs/puppetlabs-docker
libvirt: https://github.com/cirrax/puppet-libvirt
archive: https://github.com/voxpupuli/puppet-archive
concat: https://github.com/puppetlabs/puppetlabs-concat
ssh_keys: https://github.com/puppetlabs/puppetlabs-sshkeys_core
Expand Down
14 changes: 14 additions & 0 deletions site/profiles/REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* [`profiles::docker`](#profiles--docker): installs docker
* [`profiles::github_runners`](#profiles--github_runners): configures a self-hosted github runner
* [`profiles::grafana`](#profiles--grafana): installs grafana to display stats from dropsonde about Vox Pupuli modules
* [`profiles::libvirt`](#profiles--libvirt): installs libvirt
* [`profiles::nginx`](#profiles--nginx): multiple profiles requires nginx vhosts, this profile pulls in the nginx class/package/service setup
* [`profiles::node_exporter`](#profiles--node_exporter): install node_exporter
* [`profiles::postfix`](#profiles--postfix): installs postfix
Expand Down Expand Up @@ -173,6 +174,7 @@ The following parameters are available in the `profiles::github_runners` class:
* [`repo_name`](#-profiles--github_runners--repo_name)
* [`setup_ruby`](#-profiles--github_runners--setup_ruby)
* [`setup_docker`](#-profiles--github_runners--setup_docker)
* [`setup_libvirt`](#-profiles--github_runners--setup_libvirt)
* [`runner_group`](#-profiles--github_runners--runner_group)

##### <a name="-profiles--github_runners--labels"></a>`labels`
Expand Down Expand Up @@ -239,6 +241,14 @@ installs docker for beaker jobs

Default value: `false`

##### <a name="-profiles--github_runners--setup_libvirt"></a>`setup_libvirt`

Data type: `Boolean`

installs libvirt and adds the user to the group

Default value: `false`

##### <a name="-profiles--github_runners--runner_group"></a>`runner_group`

Data type: `Optional[String[1]]`
Expand Down Expand Up @@ -287,6 +297,10 @@ Data type: `String[1]`

Default value: `$postgresql_user`

### <a name="profiles--libvirt"></a>`profiles::libvirt`

installs libvirt

### <a name="profiles--nginx"></a>`profiles::nginx`

multiple profiles requires nginx vhosts, this profile pulls in the nginx class/package/service setup
Expand Down
17 changes: 14 additions & 3 deletions site/profiles/manifests/github_runners.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# @param repo_name set it to configure an repo-specific and not org specific runner
# @param setup_ruby installs ruby for rspec-puppet unit tests
# @param setup_docker installs docker for beaker jobs
# @param setup_libvirt installs libvirt and adds the user to the group
# @param runner_group the group that we will assign to the runners. Needs to exist
#
# @see code provided by CERN
Expand All @@ -24,16 +25,22 @@
Array[String[1]] $instances = [],
Boolean $setup_ruby = false,
Boolean $setup_docker = false,
Boolean $setup_libvirt = false,
Optional[String[1]] $runner_group = undef,
) {
package { ['jq', 'libffi-dev', 'libyaml-dev', 'libreadline-dev', 'zlib1g-dev', 'libssl-dev',]:
ensure => 'installed',
}
$home = "/opt/${user}"
$groups = if $setup_docker {
$groups_d = if $setup_docker {
['docker']
} else {
undef
[]
}
$groups_l = if $setup_libvirt {
['libvirt']
} else {
[]
}

user { $user:
Expand All @@ -44,7 +51,7 @@
home => $home,
forcelocal => true,
shell => '/usr/sbin/nologin',
groups => $groups,
groups => $groups_d + $groups_l,
# Notify the class to reload the runner
# require when the docker integration is added later on
notify => Class['github_actions_runner'],
Expand Down Expand Up @@ -93,6 +100,10 @@
require profiles::docker
}

if $setup_libvirt {
require profiles::libvirt
}

# some github actions want to configure repos
# ideally we update gha-puppet and our self hosted runners already have the packages installed
include sudo
Expand Down
8 changes: 8 additions & 0 deletions site/profiles/manifests/libvirt.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# @summary installs libvirt
#
# @author Tim Meusel <[email protected]>
#
class profiles::libvirt {
contain libvirt
}
4 changes: 4 additions & 0 deletions site/profiles/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
{
"name": "puppetlabs/docker",
"version_requirement": ">= 10.0.1 < 11.0.0"
},
{
"name": "cirrax/libvirt",
"version_requirement": ">= 5.0.4 < 6.0.0"
}
]
}

0 comments on commit ca175be

Please sign in to comment.