ansible-vault | : key : Ansible role for Hashicorp Vault | DevOps library

 by   ansible-community HTML Version: 2021.04.01 License: BSD-2-Clause

kandi X-RAY | ansible-vault Summary

kandi X-RAY | ansible-vault Summary

ansible-vault is a HTML library typically used in Devops, Ansible applications. ansible-vault has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

:key: Ansible role for Hashicorp Vault
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ansible-vault has a low active ecosystem.
              It has 195 star(s) with 131 fork(s). There are 12 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 7 open issues and 64 have been closed. On average issues are closed in 42 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of ansible-vault is 2021.04.01

            kandi-Quality Quality

              ansible-vault has no bugs reported.

            kandi-Security Security

              ansible-vault has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              ansible-vault is licensed under the BSD-2-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              ansible-vault releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ansible-vault
            Get all kandi verified functions for this library.

            ansible-vault Key Features

            No Key Features are available at this moment for ansible-vault.

            ansible-vault Examples and Code Snippets

            No Code Snippets are available at this moment for ansible-vault.

            Community Discussions

            QUESTION

            connecting to a remote host with ansible-vault encrypted private key does not work
            Asked 2021-May-24 at 15:15

            I can ssh to a remote server if I use the ansible command module

            e.g

            ...

            ANSWER

            Answered 2021-May-24 at 15:15

            My legendary colleague found a solution if anyone else comes across the same issue.

            Ansible SSH private key in source control?

            You need to copy your encrypted ssh private key to another file first to decrypt it and then you can use it e.g.

            Source https://stackoverflow.com/questions/67672407

            QUESTION

            Using credentials securely in ansible inventory
            Asked 2021-Apr-18 at 13:03

            In order to connect to a windows host I will need to pass the credentials in an inventory file. Here's my inventory file:

            ...

            ANSWER

            Answered 2021-Apr-18 at 13:03

            The ansible-vault command encrypts a single file. Ansible decrypts this at runtime and interprets it the same way it would if the file had been unencrypted (so you can't "store both the variable file used in my inventory and the variable file used in my playbook in the same ansible-vault" because those are two different files).

            I would just remove the variable from your inventory, leaving it like this:

            Source https://stackoverflow.com/questions/67134392

            QUESTION

            What is the Ansible vault password file format?
            Asked 2021-Apr-04 at 07:23

            I've been searching all over but there's not much on what should the Ansible vault password file look like.

            For example I would like to do:

            ...

            ANSWER

            Answered 2021-Apr-04 at 07:23

            The content of a Ansible vault password file should contain only the password for the Ansible vault.

            Somewhat vaguely described in the official documentation: https://docs.ansible.com/ansible/latest/user_guide/vault.html#setting-a-default-password-source

            That is if you do:

            Source https://stackoverflow.com/questions/66938926

            QUESTION

            How to pass a variable in a JSON string in bash script
            Asked 2021-Apr-03 at 16:23

            i have below script while gets some command output from a host and keeps that into a file /tmp/${stcl}_aggr.txt, further this file is placed to a variable body=$(cat /tmp/${stcl}_aggr.txt)

            While calling this Variable body into a Jason arrays as "description": "$body" its value is not getting expanded and resulting in error as KeyError: 'result', and the varible like incident_number, curloutput also not working while if i remove that body for "description": then script will run but the i need "description": value to be uploaded.

            ...

            ANSWER

            Answered 2021-Apr-03 at 16:23

            I can reproduce similar to my lab, So, as per my understanding below should work for you.

            Source https://stackoverflow.com/questions/66924847

            QUESTION

            Ansible Vault - Same Git repo for Prod & Test
            Asked 2021-Mar-22 at 19:30

            Apologies for the lengthy post. I am a relatively newbie to Ansible and Vault (<2 months).

            Environment:

            • CentOS & Win2019 (90% Linux systems)
            • Ansible 2.10.7 (master Ansible controller)
            • AWX 17.0.1 (embedded ansible 2.9.17)

            Ultimate goals:

            • Use the same code from Git for both environments (Prod & Test)
            • Ability to separate the 'secrets' values based on which environment

            Basic Setup (currently):

            • Ansible master controller is designed to be completely self-starting. Meaning all the settings/configs are contained within playbooks. This means I can blow-up the ANS controller and rebuild with 3 min.
            • All secrets are encrypted strings within a variable file. Due to the fact AWX cannot import an vaulted file, all secrets are in-line (ansible-vault encrypt_string 'secret_data' --name 'my_secret')
            • Same user accounts exists in both environments but different creds

            Current Issues:

            • If was to import the Git repo into my Prod Ansible master controller, any plays requiring secrets would fail (due it has the secret variable with the 'Test' values)

            Thoughts to resolve:

            • I thought about using the ansible 'default' function for any secret combined with a 'when' conditional based on the Inventory file. Basically if the inventory file is a 'Test' based system, use 'Test' secrets. If not, then use 'Prod' secrets.

            This is an ugly solution from my perspective and must be a better solution.

            • Use Hashicorp Vault. It has the ability to use namespace trees to classify creds. I have not played with this idea yet and not sure how viable it is.

            I wonder what others in the industry are doing for this same problem. This is not unique issue and sure there are best practices for this situation.

            Thanks

            ...

            ANSWER

            Answered 2021-Mar-22 at 19:30

            As you want different variables based on your environment (vault secrets are just another variables) then you could use separate inventories for each environment, see https://docs.ansible.com/ansible/2.8/user_guide/playbooks_best_practices.html#alternative-directory-layout. Then, for example, inventories/prod/group_vars/all.yml would have prod vault secrets... You would specify explicitly each inventory with ansible -i inventories/prod ....

            In this inventories layout you could share a variable file between environments with symlinks, eg. inventories/prod/group_vars/all/010_cross_env_vars.yml would be a symlink to ../../../010_cross_env_vars.yml, thus pointing to variable files located in parent directory of per-environment subdirectories, ie. inventories/010_cross_env_vars.yaml.

            Source https://stackoverflow.com/questions/66696399

            QUESTION

            Ansiblle become fails with vault
            Asked 2021-Mar-11 at 18:06

            I've created an encrypted credent.yml file with this content:

            ...

            ANSWER

            Answered 2021-Mar-11 at 18:06

            I've checked credent.yml and run

            yamllint credent.yml

            That show me the syntax errors.

            I've added --- at the top of file and escaped special chars.

            Doing that the playbook runs fine.

            Source https://stackoverflow.com/questions/66585553

            QUESTION

            How to use `ansible-vault` `--output` to write the encrypted content to a file?
            Asked 2021-Feb-10 at 00:07

            I'm using ansible-vault 2.10.5. According to the encrypt_string documentation, I can use --output to save the encrypted result. The doc says:

            --output

            output file name for encrypt or decrypt; use - for stdout

            But I tried several commands and the result seemed to always be printed to the console. For example:

            ...

            ANSWER

            Answered 2021-Feb-09 at 22:00

            I'd rather put the target content to be encrypted in a file and use ansible-vault encrypt secretfile and it will enctypt the file in place.

            Source https://stackoverflow.com/questions/66118460

            QUESTION

            How to evaluate a yaml key using jinja and then evaluate its value using jinja in .j2 file using ansible?
            Asked 2021-Jan-23 at 22:52

            I have a kubernetes secrets manifest in the form of secret.j2 file which has a password key. This password key is supposed assigned a value from an ansible-vault encrypted string present in a dev.yml file. This dev.yml looks like below:-

            ...

            ANSWER

            Answered 2021-Jan-23 at 22:52

            Q: "evaluate the dev_db_password ... while ansible templates secret.j2. Is there a way to achieve this in the same line by modifying dbpassword: ... ?"

            A: Yes. There is. Try lookup plugin vars. See ansible-doc -t lookup vars

            Source https://stackoverflow.com/questions/65863662

            QUESTION

            Ansible Read csv file and encrypt passwords, output of command to file
            Asked 2020-Dec-30 at 16:28

            I have a csv file containing ip addresses and passwords. These passwords need to be encrypted and written to a file.

            This is what I have tried so far:

            ...

            ANSWER

            Answered 2020-Dec-30 at 16:28

            You are registering a variable on a task with a loop. This changes the structure of the data as described in the documentation. Debugging output would have given you a clue.

            output.results is a list where each element contains a stdout key (e.g. the first one being output.results.0.stdout). Moreover, each element also contains an item key containing the original element in the loop that was registered.

            Modifying your last task like below should give you the expected result:

            Source https://stackoverflow.com/questions/65509410

            QUESTION

            Is it possible to parse encrypted Ansible vault values from a dynamic inventory in a playbook?
            Asked 2020-Nov-27 at 13:05

            I have a dynamic inventory set up which pulls hosts and their variables from a MySQL database. The dynamic inventory itself is working perfectly.

            Some of the variables inside the inventory are sensitive so I would prefer not to store them as plain text.

            So as a test I encrypted a value using:

            ...

            ANSWER

            Answered 2020-Nov-27 at 13:05

            You'll be better off putting the variables into the encrypted files. Store the encrypted files in MySQL instead of encrypted variables. If you already "have a dynamic inventory set up which pulls hosts and their variables from a MySQL database" there shouldn't be a problem to modify the setup. Pull the encrypted files from the database and store them in host_vars (and/or group_vars, play vars, role vars ...) instead of storing encrypted variables in the inventory (and/or in the code of playbook, role, ...). This way, in the code, you don't care whether a variable is encrypted or not.

            For example

            Source https://stackoverflow.com/questions/65036796

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ansible-vault

            Brian Shumates transferred this role to @ansible-community/hashicorp-tools. This role resides on GitHub pending fixing the integration with Ansible Galaxy. To install this role create a roles/requirements.yml file in your Ansible project folder with the following contents:. You can use git tag in the version attribute. Also you can honor its legacy name: brianshumate.ansible-vault.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular DevOps Libraries

            ansible

            by ansible

            devops-exercises

            by bregman-arie

            core

            by dotnet

            semantic-release

            by semantic-release

            Carthage

            by Carthage

            Try Top Libraries by ansible-community

            molecule

            by ansible-communityPython

            ansible-lint

            by ansible-communityPython

            ara

            by ansible-communityPython

            ansible-bender

            by ansible-communityPython

            ansible-consul

            by ansible-communityHTML