Skip to contentSkip to conversation

linux-mirror: Add Fedora-specific tasks

RFC PATCH In review [email protected] 3 participants 6 messages May 1, 2024 – May 2, 2024

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/3 linux-mirror: Add Fedora-specific tasks

From: Chuck Lever <[email protected]>

To get mirroring to work on Fedora, I had to install the git-daemon package, because on Fedora, git-daemon is not included in the git-core package.

Also, Fedora's default firewall configuration does not permit git traffic.

---
 .../tasks/install-deps/fedora/main.yml        | 24 +++++++++++++++++++
 playbooks/roles/linux-mirror/tasks/main.yml   |  5 ++++
 2 files changed, 29 insertions(+)
 create mode 100644 playbooks/roles/linux-mirror/tasks/install-deps/fedora/main.yml
playbooks/roles/linux-mirror/tasks/install-deps/fedora/main.yml new file +24 -0
new file mode 100644
index 000000000000..2a93256a3d6e
@@ -0,0 +1,24 @@
+---
+- name: Install Fedora-specific dependencies
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.package:
+    name:
+      - git-daemon
+    state: present
+  when:
+    - install_linux_mirror|bool
+
+- name: Open the firewall on control node for git traffic
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.posix.firewalld:
+    zone: libvirt
+    port: 9418/tcp
+    permanent: true
+    immediate: true
+    state: enabled
+  when:
+    - install_linux_mirror|bool
playbooks/roles/linux-mirror/tasks/main.yml +5 -0
index 461e131c93fd..a8f673c6d4ee 100644
@@ -10,6 +10,11 @@
       skip: true
   tags: vars
 
+- name: Install dependencies for the linux-mirror role
+  ansible.builtin.include_tasks: install-deps/fedora/main.yml
+  when:
+    - ansible_distribution == 'Fedora'
+
 - name: Set up the mirrors.yaml based on preferences configured
   tags: [ 'mirror' ]
   template:

base-commit: d97440f49b5b5ecb65383a1874014391ca795899

Signature · 1 line
2.44.0
#1 lore raw

RFC PATCH 2/3 get-distro-default-bridge.sh: Remove "http://"

From: Chuck Lever <[email protected]>

The script should always return only an IP address, not a URL.

---
 scripts/get-distro-default-bridge.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/get-distro-default-bridge.sh +1 -1
index 09d09ff04ee1..d85625c4ebd8 100755
@@ -9,7 +9,7 @@ VIRT_TYPE=$2
 # a different deafult it should be easy for you to extend it here.
 
 if [[ "$VIRT_TYPE" == "vagrant" ]]; then
-	echo "http://192.168.124.1"
+	echo "192.168.124.1"
 else
 	echo "192.168.122.1"
 fi
Signature · 1 line
2.44.0
#2 lore raw

RFC PATCH 3/3 get-distro-default-bridge.sh: Set specific IP address for Fedora

In reply to [email protected]

From: Chuck Lever <[email protected]>

Fedora appears to use 192.168.122.1 for both guestfs and vagrant.

---
 scripts/get-distro-default-bridge.sh | 6 ++++++
 1 file changed, 6 insertions(+)
scripts/get-distro-default-bridge.sh +6 -0
index d85625c4ebd8..d1321db5acf2 100755
@@ -8,6 +8,12 @@ VIRT_TYPE=$2
 # is if you are using vagrant or guestfs. If your distribution needs
 # a different deafult it should be easy for you to extend it here.
 
+DISTRO_FEDORA=`scripts/os-release-check.sh fedora`
+if [[ "$DISTRO_FEDORA" == "y" ]]; then
+	echo "192.168.122.1"
+	exit 0
+fi
+
 if [[ "$VIRT_TYPE" == "vagrant" ]]; then
 	echo "192.168.124.1"
 else
Signature · 1 line
2.44.0
#3 lore raw
In reply to [email protected]
Quoted 6 lines · On Wed, May 01, 2024 at 10:03:33AM -0400, [email protected] wrote:

From: Chuck Lever <[email protected]>

To get mirroring to work on Fedora, I had to install the git-daemon package, because on Fedora, git-daemon is not included in the git-core package.

Quoted 6 lines

Also, Fedora's default firewall configuration does not permit git traffic.

---
 .../tasks/install-deps/fedora/main.yml        | 24 +++++++++++++++++++

If it turns out that RHEL/CentOS needs this treatment as well, we can rename this install-deps/redhat/main.yml, and change the "when:" clause below.

I don't have a RHEL/CentOS control node on hand to test that.

Quoted 55 lines
 playbooks/roles/linux-mirror/tasks/main.yml   |  5 ++++
 2 files changed, 29 insertions(+)
 create mode 100644 playbooks/roles/linux-mirror/tasks/install-deps/fedora/main.yml
playbooks/roles/linux-mirror/tasks/install-deps/fedora/main.yml new file +24 -0
new file mode 100644
index 000000000000..2a93256a3d6e
@@ -0,0 +1,24 @@
+---
+- name: Install Fedora-specific dependencies
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.package:
+    name:
+      - git-daemon
+    state: present
+  when:
+    - install_linux_mirror|bool
+
+- name: Open the firewall on control node for git traffic
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.posix.firewalld:
+    zone: libvirt
+    port: 9418/tcp
+    permanent: true
+    immediate: true
+    state: enabled
+  when:
+    - install_linux_mirror|bool
playbooks/roles/linux-mirror/tasks/main.yml +5 -0
index 461e131c93fd..a8f673c6d4ee 100644
@@ -10,6 +10,11 @@
       skip: true
   tags: vars
 
+- name: Install dependencies for the linux-mirror role
+  ansible.builtin.include_tasks: install-deps/fedora/main.yml
+  when:
+    - ansible_distribution == 'Fedora'
+
 - name: Set up the mirrors.yaml based on preferences configured
   tags: [ 'mirror' ]
   template:

base-commit: d97440f49b5b5ecb65383a1874014391ca795899

Signature · 1 line
2.44.0
Signature · 1 line
Chuck Lever
Reviewed-by on v1 1/3
#4 lore raw
In reply to [email protected]
Quoted 10 lines · On Wed, May 01, 2024 at 10:03:33AM -0400, [email protected] wrote:

From: Chuck Lever <[email protected]>

To get mirroring to work on Fedora, I had to install the git-daemon package, because on Fedora, git-daemon is not included in the git-core package.

Also, Fedora's default firewall configuration does not permit git traffic.

Luis

#5 lore raw
Quoted 11 lines · Luis Chamberlain
Quoted 6 lines · On Wed, May 01, 2024 at 10:03:33AM -0400, [email protected] wrote:

From: Chuck Lever <[email protected]>

To get mirroring to work on Fedora, I had to install the git-daemon package, because on Fedora, git-daemon is not included in the git-core package.

Quoted 6 lines
Quoted 4 lines

Also, Fedora's default firewall configuration does not permit git traffic.

Thanks! Since I didn't send a cover letter, should I assume this applies to all three patches in this series?

--
Chuck Lever