This guide installs Cockpit and enables the management web service.
- name: Install Cockpit on Debian family
hosts: cockpit_debian
become: true
tasks:
- name: Install Cockpit packages
ansible.builtin.apt:
update_cache: true
name:
- cockpit
- cockpit-system
- cockpit-networkmanager
state: present
- name: Enable and start Cockpit socket
ansible.builtin.systemd:
name: cockpit.socket
enabled: true
state: started
- name: Allow Cockpit port with UFW when available
community.general.ufw:
rule: allow
port: "9090"
proto: tcp
failed_when: false
- name: Install Cockpit on RHEL family
hosts: cockpit_rhel
become: true
tasks:
- name: Install Cockpit packages
ansible.builtin.dnf:
name:
- cockpit
- cockpit-system
- cockpit-networkmanager
state: present
- name: Enable and start Cockpit socket
ansible.builtin.systemd:
name: cockpit.socket
enabled: true
state: started
- name: Open cockpit service in firewalld
ansible.posix.firewalld:
service: cockpit
permanent: true
immediate: true
state: enabled
failed_when: false
ansible-playbook -i inventory.ini cockpit-install.yml
cockpit_debian.Beyond this playbook, we offer:
Contact our automation team: office@linux-server-admin.com