Skip to main content

Posts

Showing posts from February, 2023

Ansible - setting alternatives with dynamic path

Alternatives are a decent way in linux to set different path executables for a certain program. I'd guess that the most commonly used alternatives on modern systems are java and python. For this example, I'll use three different versions of java installed on a el8 system and use the 'community.general.alternatives' module to select the executable behind '/usr/bin/java'. First, we need to define some variables and ensure java is installed: - name: deploy java hosts: test user: root become: false gather_facts: true collections: - community.general vars: java_selected_version: "{{ java_future_version }}" java_legacy_version: '1.8.0' java_current_version: '11' java_future_version: '17' tasks: - name: install java packages ansible.builtin.package: name: - "java-{{ java_legacy_version }}-openjdk" - "java-{{ java_legacy_version }}-o

Foreman - '403 Forbidden' when downloading katello-ca-consumer-latest.noarch.rpm

So recently after the update to Foreman 3.5 and Katello 4.7, I was not able to register hosts to foreman during the kickstart installation and the automatic installation returned a 403 forbidden error. Forbidden errors usually point to permissions issues on the files being accessed but let's check the logs first: [root@katello01 ~]# tail -n 5 /var/log/httpd/foreman_error.log [Wed Jan 25 21:44:42.163317 2023] [core:error] [pid 73542:tid 140108057532160] (13)Permission denied: [client 172.31.10.138:60944] AH00132: file permissions deny server access: /var/www/html/pub/katello-ca-consumer-latest.noarch.rpm The logs confirm it's a permission issue, so change the permissions of the files to '644' if they aren't already. [root@katello01 ~]# find /var/www/html/pub -maxdepth 1 -type f -name '*katello-ca-consumer*' ! -perm 644 -exec chmod 644 {} \; You will not need to restart httpd for this to take affect. Provisioning VMs should now be working again. Feel