Skip to content

ruslaniv/ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible

Using Ansible to configure remote CentOS server.

Fabric

Ansible is not very convenient to perform initial server configuration, specifically I have found it hard to perform the following tasks:

  1. Transfer an SHH public key to the remote server right after server initialization.
  2. Programmatically add server SSH fingerprint to local "known_hosts" file
  3. Programmatically change SSH port.

Fabric can easily automate these tasks. Fabric is a high level imperative style shell command execution library written in python.
I found it very useful to perform initial configuration of a remote server, having only root username and password provided by the cloud operator when you buy a VM instance. All you need to do is:

pip install fabric

And then Fabric scripts can be run as a regular python scripts. Since Fabric is imperative it is somewhat cumbersome to achieve idempotency, and a lot of if statements have to be used to check for various conditions. In this regard, Ansible abstracts away a lot of such complexities. So as soon as initial server configuration is completed, you can switch to Ansible to perform the rest of configuration tasks.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages