2

Fresh Fedora Server Netinstall. Updated. Installed only Git and Ansible latest versions from standard repo.

Want to execute Ansible against it's own host (localhost) to set up its host itself (not using ansible-pull). Copied ssh-keys. Connected via SSH as non-root user, but with root rights from some remote machine, Git-pulled my Ansible inventory.

$ ansible --version => ansible 2.9.6
$ python --version => Python 3.7.6

So, Ansible is installed and accessible. However, when running

ansible-paybook play/bastion.yml --tags nvim:install --ask-vault-pass

i do get -bash: ansible-playbook: command not found. Same for other sub-commands.

When going into machine directly with the same user ansible-playbook works as expected.

What could be wrong with SSH'ing into it?

Ideally i shouldn't (don't need) to SSHch into it, because eventually i will call ansible-pull. This is only for 'polishing' playbooks against vanilla machine because tty is not so comfortable to use.

Dzintars
  • 181
  • 1
  • 1
  • 7
  • Digging further found this - https://stackoverflow.com/a/10564729/6651080. Thinking it's a right direction, but not the solution for the current case. – Dzintars Mar 21 '20 at 22:30

1 Answers1

0

I think it's path environment variable issue, that means that the user profile is not loaded when doing ssh, check your PATH when doing ssh and without ( locally ) and compare bothe

echo $PATH

If so then check your ssh configuration file and enable PermitUserEnvironment.

Reda Salih
  • 231
  • 2
  • 7