AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,400 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of 8 Ansible books published by Apress and Leanpub including "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example", and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

Ansible on openSUSE Leap 15.6 Automation Complete Guide

By Luca Berton · Published 2024-01-01 · Category: installation

Automate openSUSE Leap 15.6 with Ansible: zypper, AppArmor, firewalld, Cockpit, Podman, YaST integration, and migration to Leap Micro / SLES.

openSUSE Leap 15.6 is the community release built on the same SLE 15 SP6 source. It targets developers, lab servers, and home users who want SLES-quality stability without subscription. Leap 15.6 ships kernel 6.4, Python 3.11, OpenSSH 9.6, AppArmor, and firewalld. It is supported through December 2025 and (with extension) into 2026, after which users migrate to Leap Micro 6.x or openSUSE Slowroll. This guide covers Ansible automation on Leap 15.6.

openSUSE Leap 15.6 release facts

| Item | Value | |---|---| | Release | 2024-06-12 | | EOL | 2025-12-31 (extended community support) | | Default kernel | 6.4 | | Default Python | 3.11 | | Package manager | zypper | | MAC | AppArmor |

See also: Ansible on openSUSE Tumbleweed Automation Complete Guide

Ansible-core compatibility

Use ansible-core 2.18 LTS.

Baseline playbook

- name: openSUSE Leap 15.6 baseline
  hosts: leap156
  become: true
  tasks:
    - name: Refresh repos
      community.general.zypper_repository: { repo: "*", autorefresh: true, runrefresh: true }

- name: Update packages community.general.zypper: { name: "*", state: latest }

- name: Install baseline tools community.general.zypper: name: [vim, chrony, firewalld, apparmor-utils, cockpit, podman, htop] state: present

- name: Enable services ansible.builtin.service: name: "{{ item }}" enabled: true state: started loop: [chronyd, firewalld, cockpit.socket]

See also: Ansible on SUSE Linux Enterprise Server 15 SP6 Automation Complete Guide

YaST as a fallback (idempotent CLI)

- name: Use YaST to add a user (when AD/LDAP not available)
  hosts: leap156
  become: true
  tasks:
    - name: yast users add
      ansible.builtin.command: yast users add username=devops password={{ vault_devops_pass }} no_home=yes
      register: yast
      changed_when: "'created' in yast.stdout"

Migration path: Leap 15.6 -> SLES 15 SP6

- name: Migrate Leap 15.6 to SLES 15 SP6
  hosts: leap156
  become: true
  tasks:
    - name: Download SLES migration tool
      ansible.builtin.get_url:
        url: https://download.suse.com/migration/leap-to-sles.sh
        dest: /root/leap-to-sles.sh
        mode: "0755"

- name: Run migration with reg code ansible.builtin.command: /root/leap-to-sles.sh -r {{ scc_regcode }} -e {{ scc_email }} args: creates: /etc/SuSE-brand

See also: Ansible on SUSE Linux Enterprise Server 16 Automation Complete Guide

Best practices

• Plan the post-EOL migration to Leap Micro, openSUSE Slowroll, or SLES well before December 2025. • Use the same community.general.zypper patterns from SLES playbooks — Leap shares the SLES code base. • AppArmor profiles authored for Leap usually port unchanged to SLES.

Conclusion

openSUSE Leap 15.6 is the community face of SLES 15. Ansible playbooks translate 1:1 between the two, making Leap an excellent free testbed for SLES-bound automation.

Category: installation

Browse all Ansible tutorials · AnsiblePilot Home