ansible

Windows Server 2012 R2 and AWS S3 Download from Ansible

≡放荡痞女 提交于 2020-08-26 11:18:10
问题 I'm trying to download some files from AWS S3 with IAM Role for EC2 but Ansible is getting an error. Other Ansible win_* modules works great. Windows Server has Python2 and Python3, and also boto and boto3 modules. Cmd is responding to python command. It opens Python3 when it is executed. I also tested the 'import boto' command when the Python3 is opened to be sure that module is installed. Ansible Playbook is configured like: - name: test s3 module hosts: windows tasks: - name: get s3 file

How to view/decrypt Ansible vault credentials files from within a Python script?

落爺英雄遲暮 提交于 2020-08-21 11:36:07
问题 I'm trying to figure out how to provide the following facilities to a Python script so that it can: Import Ansible Python modules Open up my defined ansible.cfg and read vault_password_file variable Read vault_password_file and temporarily store in a Python variable Decrypt a referenced Ansible vaulted file I found this code via google but it did not appear to work when I tried it: import ansible.utils bar = dict() bar = ansible.utils._load_vars_from_path("secrets.yml", results=bar, vault