↓ Skip to main content
Linux

Ansible: Notes

·1 min
Official documentation notes (Self Read)

Control node
Managed nodes
Inventory
Modules
Tasks
Playbooks

Building blocks for Ansible.

  </div><div class="tab__panel " data-tab-index="1">
    <div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl">

A playbook is composed of one or more ‘plays’ in an ordered list. — Official documentation

  • Ordered lists of tasks, saved so you can run those tasks in that order repeatedly.
  • Expressed in YAML format
  • It offers a multi-machine configuration & deployment system for complex applications that is
    • Repeatable
    • Re-usable &
    • Simple
  • Controller machine
  • Has the Ansible executable installed (+Python)
  •   </div><div class="tab__panel " data-tab-index="3">
        <ul>
    
  • List of nodes/hosts that will be managed by control node
  •   </div><div class="tab__panel " data-tab-index="4">
        <ul>
    
  • List of nodes
  • Can specify information like IP address for each managed node.
  • An inventory can also organise managed nodes in groups e.g. [webserver]
  •   </div><div class="tab__panel " data-tab-index="5">
        <ul>
    
  • The units of code Ansible executes.
  •   </div><div class="tab__panel " data-tab-index="6">
        The units of action in Ansible
      </div></div>
    
    Author
    Samarthya
    Engineer, learner, tinkerer. This is my trophy shelf of everyday work and leisure.

    Related

    Bash: Named Reference

    Bash is different world. Powerful, simple, elegant and complex all at the same time. Recently while trying to reduce the burden of repetitive code, I was trying to check what can be done to use references in Bash (something like pointers) and it was an interesting problem that I enjoyed solving.

    SSH Protocol

    ·2 mins
    💬 What is SSH protocol? 💬 It is also referred to as Secure Shell, is a method for secure remote login from one computer to another. It is an alternative to telnet and rlogin

    ssh-keygen & ssh-copy-id

    ·2 mins
    ssh-keygen allows generation of new key pair for authentication (SSH). > ssh-keygen --help unknown option -- - usage: ssh-keygen [-q] [-b bits] [-t dsa | ecdsa | ed25519 | rsa | rsa1] [-N new_passphrase] [-C comment] [-f output_keyfile] ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile] ssh-keygen -i [-m key_format] [-f input_keyfile] ssh-keygen -e [-m key_format] [-f input_keyfile] ssh-keygen -y [-f input_keyfile] ssh-keygen -c [-P passphrase] [-C comment] [-f keyfile] ssh-keygen -l [-v] [-E fingerprint_hash] [-f input_keyfile] ssh-keygen -B [-f input_keyfile] ssh-keygen -D pkcs11 ssh-keygen -F hostname [-f known_hosts_file] [-l] ssh-keygen -H [-f known_hosts_file] ssh-keygen -R hostname [-f known_hosts_file] ssh-keygen -r hostname [-f input_keyfile] [-g] ssh-keygen -G output_file [-v] [-b bits] [-M memory] [-S start_point] ssh-keygen -T output_file -f input_file [-v] [-a rounds] [-J num_lines] [-j start_line] [-K checkpt] [-W generator] ssh-keygen -s ca_key -I certificate_identity [-h] [-n principals] [-O option] [-V validity_interval] [-z serial_number] file ... ssh-keygen -L [-f input_keyfile] ssh-keygen -A ssh-keygen -k -f krl_file [-u] [-s ca_public] [-z version_number] file ... ssh-keygen -Q -f krl_file file ... ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: SHA256:KjqBCXEEFIBOOPDJ6j45tOBogwggxw3pAqECLG/r9fI root@mymachine.net The key's randomart image is: +---[RSA 2048]----+ |%* . | |%==. | |O*+o | |*o* . | |=* . S | |*.o . . | |Oooo... | |=Oo.... | |..=. oE | +----[SHA256]-----+ SSH Keys