Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anisble 2.2.0.0 fails to decrypt an encrypted inventory #18364

Closed
erikmouw opened this issue Nov 4, 2016 · 3 comments
Closed

Anisble 2.2.0.0 fails to decrypt an encrypted inventory #18364

erikmouw opened this issue Nov 4, 2016 · 3 comments
Labels
affects_2.2 This issue/PR affects Ansible v2.2 bug This issue/PR relates to a bug.

Comments

@erikmouw
Copy link

erikmouw commented Nov 4, 2016

ISSUE TYPE
  • Bug Report
COMPONENT NAME

Ansible-vault

ANSIBLE VERSION
ansible 2.2.0.0
  config file = /home/ansible/ansible/ansible.cfg
  configured module search path = Default w/o overrides
CONFIGURATION
[defaults]
inventory = hosts
remote_user = root
roles_path = roles
ask_vault_pass=True

# enable fact caching
gathering = smart
fact_caching = jsonfile
fact_caching_connection = fact-cache
fact_caching_timeout = 3600

[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no
OS / ENVIRONMENT
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.1 LTS
Release:	16.04
Codename:	xenial
SUMMARY

Ansible no longer works with encrypted inventory files. The inventory is encrypted with ansible-vault. This used to work just fine with Ansible 2.1.2.0. Ansible is installed using the Ansible PPA repo for Ubuntu Xenial.

STEPS TO REPRODUCE
  • Create inventory with a few hosts
  • Encrypt inventory (ansible-vault encrypt hosts)
  • Try to ping all hosts in the inventory (ansible -m ping all)
ansible -m ping all
EXPECTED RESULTS
Vault password:
localhost | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
hosta | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
hostb | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
hostc | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
hostd | SUCCESS => {
    "changed": false,
    "ping": "pong"
}
ACTUAL RESULTS
$ ansible -m ping all
Vault password:
61396265376634626134356335623738373064396163643532363236386132646535656132303633 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: ControlPath too long\r\n",
    "unreachable": true
}
34373238376137316130653637313562663234333762643536626561636439616533643933396661 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: ControlPath too long\r\n",
    "unreachable": true
}
...
63616661383530386538396662386436373764653461666531396664633562636235323134646138 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: ControlPath too long\r\n",
    "unreachable": true
}
64313066373737613431 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname 64313066373737613431: Name or service not known\r\n",
    "unreachable": true
}
@ansibot ansibot added bug_report affects_2.2 This issue/PR affects Ansible v2.2 labels Nov 4, 2016
@erikmouw
Copy link
Author

erikmouw commented Nov 4, 2016

Note this bug affects both ansible and ansible-playbook.

The inventory (and all other encrypted files) were encrypted using the ansible-vault from Ansible 2.1.2.0. Rekeying the inventory using ansible-vault from 2.2.0.0 doesn't make any difference, ansible and ansible-playbook still can't decrypt the playbook.

@bcoca
Copy link
Member

bcoca commented Nov 4, 2016

dupe of #18355

@bcoca bcoca closed this as completed Nov 4, 2016
@erikmouw
Copy link
Author

erikmouw commented Nov 4, 2016

This has been sitting in my browser all day, I finally got time to submit it and didn't see the other report. If you still need more information to reproduce the issue, feel free to reopen this one.

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.2 This issue/PR affects Ansible v2.2 bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants