Chapter 3. Example playbooks based on modules from Satellite Ansible Collection
Questo contenuto non è disponibile nella lingua selezionata.
Chapter 3. Example playbooks based on modules from Satellite Ansible Collection
All playbooks based on modules from Satellite Ansible Collection must include parameters detailing how to connect to the Satellite API. The following examples use Ansible vault and module defaults group to provide these parameters, and they authenticate using a username and password. For more information, see Chapter 2, Creating a playbook with modules from Satellite Ansible Collection.
Additional resources
Use the ansible-doc --list redhat.satellite command to display the Satellite Ansible modules installed on your system.
- name: Ensure Red Hat Enterprise Linux 9 repositories are synced and content view is published
hosts: localhost
vars_files:
- My_Vault.yml
module_defaults:
group/redhat.satellite.satellite:
username: "{{ My_Username }}"
password: "{{ My_Password }}"
server_url: "{{ My_Server_URL }}"
tasks:
- name: Sync Red Hat Enterprise Linux repositories
redhat.satellite.repository_sync:
product: "Red Hat Enterprise Linux for x86_64"
organization: "Default Organization"
- name: Publish Red Hat Enterprise Linux 9 content view
redhat.satellite.content_view_version:
content_view: "Red Hat Enterprise Linux 9 content view"
organization: "Default Organization"
- name: Ensure Red Hat Enterprise Linux 9 repositories are synced and content view is published
hosts: localhost
vars_files:
- My_Vault.yml
module_defaults:
group/redhat.satellite.satellite:
username: "{{ My_Username }}"
password: "{{ My_Password }}"
server_url: "{{ My_Server_URL }}"
tasks:
- name: Sync Red Hat Enterprise Linux repositories
redhat.satellite.repository_sync:
product: "Red Hat Enterprise Linux for x86_64"
organization: "Default Organization"
- name: Publish Red Hat Enterprise Linux 9 content view
redhat.satellite.content_view_version:
content_view: "Red Hat Enterprise Linux 9 content view"
organization: "Default Organization"
Copy to ClipboardCopied!Toggle word wrapToggle overflow
For more information, see the Ansible module documentation with the following commands:
Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.
Rendiamo l’open source più inclusivo
Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.
Informazioni su Red Hat
Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.