Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Repeating errors on ansible after changing variables
Post Body

Hey guys. I'm really new to Ansible and automation platforms but I'm diving in to get as much knowledge as possible and really appreciate all the work shown here and on the documentation. I'm working thru a series of errors right now and could use some help.

I'm trying to connect to a singular VM right now. Ansible is spun up with plugins installed, tested, and with a plugin for StrongDM, got successful connections. However, when I'm working on a VM that isn't there, am getting an error:

/etc/ansible$ ansible linux -m ping

[WARNING]: * Failed to parse /etc/ansible/hosts with yaml plugin: We were unable to read either as JSON nor YAML, these are the errors we got from each: JSON: Expecting value: line 1 column 1 (char 0) Syntax Error while loading YAML. did not find expected <document start> The error appears to be in '/etc/ansible/hosts': line 8, column 1, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: [linux] IP.x.x.x ^ here [WARNING]: * Failed to parse /etc/ansible/hosts with ini plugin: /etc/ansible/hosts:23: Expected key=value host variable assignment, got: ansible_host

[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source

[WARNING]: No inventory was parsed, only implicit localhost is available

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

IP.x.x.x | UNREACHABLE! => {

"changed": false,

"msg": "Failed to connect to the host via ssh: [email protected]: Permission denied (publickey).",

"unreachable": true

}

I changed my username to run as a local acct on the target VM but it is still referring back to my specific username.

My hosts file:
# This is the default ansible 'hosts' file.
# It should live in /etc/ansible/hosts
#ssh user, this user should allow ssh based auth without requiring a password
#if using ssh key based auth

[linux]
IP.x.x.x

[linux:vars]
ansible_user=ansibleuseracct
ansible_password=P@ssw0rd

I also minimized the CFG file to this:
# ansible.cfg
[defaults]
# Specify the inventory file (list of hosts)

inventory = /etc/ansible/hosts

# uncomment this to disable SSH key host checking

host_key_checking = False

[inventory]

enable_plugins = yaml, ini

Am I missing something from the basic setup and config?

Author
Account Strength
100%
Account Age
9 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,243
Link Karma
740
Comment Karma
503
Profile updated: 4 days ago
Posts updated: 4 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
8 months ago