Skip to content

qtekfun/ansible-servers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible-servers

This is my playbook to configure the basic stuff in my servers

Instructions

Prerequisites and basic test

  1. Configure ssh-key access to the servers
  2. Add ssh identyties to your ssh-agent. To do that:
    • Execute eval "$(ssh-agent -s)". It should be like:
      $ eval "$(ssh-agent -s)"
      > Agent pid XXXXX
    • And then run ssh-add ~/.ssh/i<key name>
  3. Install ansible
  4. Create yout hosts inventory, or global one in /etc/ansible/hosts or a local one. As an example:
    [all]
    192.168.1.254
    192.168.1.253
    
  5. Run the following to clarify if the server is working with ansible:
    ansible -i hosts all -u <user in the server> -m ping
    
    At this point, if all is working fine, you will se this:
    192.168.1.254 | SUCCESS => {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false,
        "ping": "pong"
    }
    

Run the playbook

ansible-playbook -i <inventory> -u <user> -K --extra-vars "ssh_port=<port>" main.yaml

About

This is my playbook to configure the basic stuff in my servers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published