Skip to main content

Quick commands

Check host availability

Hosts file

[<hostgroupname>]
<ipadress1>
<ipadress2>
<ipadress3>
<ipadress4>

Check availability

ansible -i hosts <hostgroupname> -m ping --user <username> --ask-pass

Update all repositories

Ansible playbook

- hosts: lnc-kubernetes
  tasks:
    - name: Update cache
      apt:
       update_cache: yes
    - name: Upgrade all packages on servers
      apt:
        name: "*"
        state: latest

Update command

ansible-playbook <pathtoplaybookfile> --user <username> --ask-pass --ask-become-pass -i <pathtohostsfile>