Giter VIP home page Giter VIP logo

setup_ubuntu_ansible's Introduction

Steps

Normally root user has password based login when we create a new machine, and to work with ansible or in general development work we want to use ssh key instead of password. To do that we can configure ssh key based login using following ways:

Setup Ansible to use ssh password

Setup root user with ssh key based login. To do that we will use this role:

ansible-galaxy install GROG.authorized-key

and install sshpass so that we can run ansible command with password

brew install hudochenkov/sshpass/sshpass

Ref: how-to-install-sshpass-on-mac

and then use this playbook to setup root ssh key in server

Setup ssh key based root login : using Ansible --ask-pass

ansible-playbook -i hosts setup-ssh-root.yml -l server1 -u root --ask-pass

Setup ssh key based root login : using ssh-copy-id

For me sshpass installation didn't work so wasn't able to use --ask-pass param in ansible command so used the ssh-copy-id command as manual step

ssh-copy-id -i  ~/.ssh/id_ed25519.pub root@rack

Now I can ssh using ssh key

ssh -i ~/.ssh/id_ed25519  root@rack

Initialize the server : Using Ansible playbook

Once the root ssh key setup is done, we can run the initial server setup plybook

ansible-playbook -i hosts playbook.yml -l server1 -u root

References

setup_ubuntu_ansible's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.