Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for RedHat distros (and Nobara) #157

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ jobs:
strategy:
matrix:
distro:
- debian11
- debian10
# https://github.com/geerlingguy/docker-ubuntu2204-ansible/issues/6
# - ubuntu2204
- ubuntu2004
- debian11 # Bullseye
- debian10 # Buster
- ubuntu2204 # Jammy
- ubuntu2004 # Focal
- fedora38
- fedora37
- centos8
- rockylinux9
- rockylinux8

steps:
- name: Check out the repository
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Extensions are installed but need to be manually enabled from Firefox.
## Requirements

[requests] is required on the remote host to install extensions.
The OS of the remote host is supported, see [ansible-galaxy staticdev/firefox].

## Role Variables

Expand Down Expand Up @@ -68,3 +69,4 @@ This Ansible role is a modified version of the [ansible-firefox] originally crea
[requests]: https://docs.python-requests.org/en/master
[staticdev]: https://github.com/staticdev
[unrblt]: https://github.com/unrblt
[ansible-galaxy staticdev/firefox]: https://galaxy.ansible.com/staticdev/firefox
12 changes: 11 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,19 @@ galaxy_info:

- name: Ubuntu
versions:
# - jammy
- jammy
- focal

- name: Fedora
versions:
- "38"
- "37"

- name: EL
versions:
- "9"
- "8"

galaxy_tags:
- workstation
- system
Expand Down
13 changes: 2 additions & 11 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,10 @@
cache_valid_time: 600
when: ansible_os_family == 'Debian'

- name: Ensure Debian dependencies are installed
ansible.builtin.apt:
name: "{{ item }}"
state: present
when: ansible_distribution == 'Debian'
with_items:
- python3-requests

- name: Ensure Ubuntu dependencies are installed
ansible.builtin.apt:
- name: Ensure dependencies are installed
ansible.builtin.package:
name: "{{ item }}"
state: present
when: ansible_distribution == 'Ubuntu'
with_items:
- python3-requests

Expand Down
3 changes: 3 additions & 0 deletions molecule/default/daemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"default-cgroupns-mode": "host"
}
2 changes: 2 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ platforms:
command: ${MOLECULE_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
# https://github.com/geerlingguy/docker-ubuntu2204-ansible/issues/6
- ${MOLECULE_SCENARIO_DIRECTORY}/daemon.json:/etc/docker/daemon.json
privileged: true
pre_build_image: true
provisioner:
Expand Down
46 changes: 46 additions & 0 deletions tasks/apt-ubuntu2204+.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
# https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04

- name: Install dirmngr
ansible.builtin.package:
name: dirmngr
state: present
become: true

- name: Add Mozilla Firefox PPA Repository
ansible.builtin.apt_repository:
repo: ppa:mozillateam/ppa
become: true

- name: Configure Mozilla Firefox PPA priority
ansible.builtin.copy:
dest: /etc/apt/preferences.d/mozilla-firefox
content: |
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
owner: root
group: root
mode: '0644'
become: true

# - name: Configure unattended upgrades for Mozilla Firefox PPA
# ansible.builtin.copy:
# dest: /etc/apt/apt.conf.d/51unattended-upgrades-firefox
# content: |
# Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:{{ ansible_distribution_codename }}";
# owner: root
# group: root
# mode: '0444'
# become: true

- name: Gather the package facts
ansible.builtin.package_facts:

- name: Install Firefox
ansible.builtin.apt:
name: "{{ firefox_package_name }}"
state: present
allow_downgrade: true
become: true
when: "'snap' in ansible_facts.packages['firefox'][0].version"
11 changes: 11 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@
ansible.builtin.package:
name: "{{ firefox_package_name }}"
state: present
become: true

- name: Gather the package facts
ansible.builtin.package_facts:
when: "ansible_distribution == 'Ubuntu'"

- name: Install Firefox for ubuntu2204+ using apt
ansible.builtin.include_tasks: apt-ubuntu2204+.yml
when: "ansible_distribution == 'Ubuntu' and 'snap' in ansible_facts.packages['firefox'][0].version"

# TODO: Add install option for ubuntu2204+ using snap

- name: Configure profiles
ansible.builtin.include_tasks: configure_profile.yml
Expand Down
3 changes: 3 additions & 0 deletions vars/Nobara.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
firefox_package_name:
- firefox
3 changes: 3 additions & 0 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
firefox_package_name:
- firefox