-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit dbb64be
Showing
9 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
name: CI | ||
|
||
'on': | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out codebase. | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run ansible-lint | ||
uses: ansible/ansible-lint@main | ||
|
||
- name: Run yamllint | ||
uses: frenck/action-yamllint@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Release | ||
|
||
'on': | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out codebase. | ||
uses: actions/checkout@v4 | ||
|
||
- name: galaxy | ||
uses: robertdebock/[email protected] | ||
with: | ||
galaxy_api_key: ${{ secrets.GALAXY_API_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
line-length: | ||
max: 120 | ||
level: warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Podman Install | ||
|
||
Ansible role to install podman on Debian based distros using [home:alvistack](https://build.opensuse.org/project/show/home:alvistack) repository. | ||
|
||
## Requirements | ||
|
||
None. | ||
|
||
## Role Variables | ||
|
||
Available variables are listed below, along with default values (see [defaults/main.yml](defaults/main.yml)): | ||
|
||
| Variable | Description | Default value | | ||
| ------------------------- | ------------------------------------------------- | ------------- | | ||
| `podman_install_packages` | List of packages to be installed within the role. | `["podman"]` | | ||
| `podman_service_state` | Podman service's state after role execution. | `started` | | ||
| `podman_service_enabled` | Wheter to enable podman service at boot. | `true` | | ||
|
||
## Dependencies | ||
|
||
None. | ||
|
||
## Example Playbook | ||
|
||
```yaml | ||
- hosts: servers | ||
vars: | ||
podman_install_packages: | ||
- podman>=4.4 | ||
- crun | ||
roles: | ||
- alorle.podman_install | ||
``` | ||
## License | ||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
podman_install_packages: | ||
- podman | ||
podman_service_state: started | ||
podman_service_enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- name: Restart podman | ||
ansible.builtin.service: | ||
name: podman.service | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
galaxy_info: | ||
role_name: podman_install | ||
namespace: alorle | ||
author: Álvaro Orduna León | ||
description: Ansible Role for Podman Installation on Debian distributions | ||
license: license MIT | ||
min_ansible_version: "2.1" | ||
platforms: | ||
- name: Ubuntu | ||
versions: | ||
- all | ||
- name: Debian | ||
versions: | ||
- all | ||
galaxy_tags: | ||
- system | ||
- podman | ||
- debian | ||
- ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
- name: Ensure os family is Debian. | ||
ansible.builtin.assert: | ||
that: "ansible_os_family =='Debian'" | ||
|
||
- name: Define repository base path. | ||
block: | ||
- name: Define Ubuntu repository base path. | ||
ansible.builtin.set_fact: | ||
repository_base_path: "xUbunut_{{ ansible_facts.distribution_version }}" | ||
when: ansible_facts.distribution == "Ubuntu" | ||
- name: Define Debian repository base path. | ||
ansible.builtin.set_fact: | ||
repository_base_path: "Debian_{{ ansible_facts.distribution_major_version }}" | ||
when: ansible_facts.distribution != "Ubuntu" | ||
|
||
- name: Ensure apt key is installed. | ||
ansible.builtin.apt_key: | ||
id: "{{ podman_apt_key.id | default(omit) }}" | ||
url: "{{ podman_apt_key.url }}" | ||
keyring: "{{ podman_apt_key.keyring }}" | ||
state: "{{ podman_apt_key.state | default('present') }}" | ||
|
||
- name: Ensure apt repository file is present. | ||
ansible.builtin.apt_repository: | ||
filename: "{{ podman_apt_repository.filename }}" | ||
repo: "{{ podman_apt_repository.repo }}" | ||
mode: "{{ podman_apt_repository.mode | default('0644') }}" | ||
state: "{{ podman_apt_repository.state | default('present') }}" | ||
|
||
- name: Ensure apt packages are installed. | ||
ansible.builtin.package: | ||
name: "{{ item }}" | ||
state: present | ||
loop: "{{ podman_install_packages }}" | ||
notify: Restart podman | ||
|
||
- name: Ensure podman is started and enabled at boot. | ||
ansible.builtin.service: | ||
name: podman | ||
state: "{{ podman_service_state }}" | ||
enabled: "{{ podman_service_enabled }}" | ||
ignore_errors: "{{ ansible_check_mode }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
podman_apt_key: | ||
keyring: /etc/apt/trusted.gpg.d/home_alvistack.gpg | ||
url: http://downloadcontent.opensuse.org/repositories/home:/alvistack/{{ repository_base_path }}/Release.key | ||
|
||
podman_apt_repository: | ||
filename: home:alvistack | ||
repo: deb http://downloadcontent.opensuse.org/repositories/home:/alvistack/{{ repository_base_path }}/ / |