thirumoorthir / ansible_test_cases

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infrastructure Admin

Creating and deploying admin keys

ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_devops_ed25519 -C "devops@zondax.ch"

Before starting the playbook, don't forget to install the public key of your master server on slaves servers, otherwise you will not be able to use it.

ssh-copy-id -i ~/.ssh/id_devops_ed25519 user@host

Inventory and public keys

  • Define host configuration at config/hosts.yaml

    Tip: There is a template at config_example/hosts.yaml

    all:
    vars:
        ansible_python_interpreter: auto
    
    hosts:
        hostABC:
        ansible_ssh_host: 1.2.3.4
        user_list:
            - user1
        sudoer_list:
            - user2
        user_zsh_list:
            - user3
    
        hostXYZ:
        ansible_ssh_host: 5.6.7.8
        user_list:
            - user1
        user_zsh_list:
            - user3
  • Considering adding these hosts to groups

    [base]
    hostABC
    hostBCD
    
    [docker]
    hostXYZ
  • Copy SSH pub keys for each users you want to create config/{USERNAME}.pub

Running Tests

  • First install dependencies

    make install_dependencies
  • To run tests use

    make test

Running Playbooks

  • To check all files are valid

    make check
  • To check node connections

    make check_nodes
  • Basic configuration

    make base
  • Configure everything

    make configure

About


Languages

Language:Makefile 100.0%