Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17842

Basic ansible, SSH help

$
0
0

I posted a script earlier and got told to use Puppet, chef or ansible, I've decided to try ansible as its meant to be easier.

I've no idea what I'm doing though and I'm struggling with the tutorial

here's the tutorial :

https://serversforhackers.com/an-ansible-tutorial

So I've got SSH and stuff on the VM that I'm using - I'm not sure if I need to use SSH for this though.

I can SSH using ssh localhost, but I can't see the point, and I certainly can't get the given command ansible all -m ping -s -k -u vagrant to do anything.

When I run that command I get :

┌─[klak @ klakBox]─[~/ansi_test]─[20:51:38] └─[$]› ansible all -m ping -s -k -u klak SSH password: ERROR: /etc/ansible/hosts:1: Invalid ini entry: 127.0.0.1 - need more than 1 value to unpack 

So I'm not sure what that means....

I've moved onto the part where the tutorial creates a basic YAML file I've created the nginx.yml file with the following contents:

--- - hosts: local tasks: - name: Install Nginx apt: pkg=nginx state=installed update_cache=true 

Then tried to run it as follows:

┌─[klak @ klakBox]─[~/ansi_test]─[20:51:35] └─[$]› ansible-playbook -s nginx.yml ERROR: /etc/ansible/hosts:1: Invalid ini entry: 127.0.0.1 - need more than 1 value to unpack 

I'm not sure why I'm getting an error, when in the tutorial he gets an output (tutorial here https://serversforhackers.com/an-ansible-tutorial)

my /etc/ansible/hosts file is as follows:

[local] 127.0.0.1 

If anyone could help that'd be ace, cheers

edit

I've updated this post to reflect a change in the hosts file

submitted by __baxx__
[link][10 comments]

Viewing all articles
Browse latest Browse all 17842

Trending Articles