Giter VIP home page Giter VIP logo

Comments (8)

prashantsomashekar avatar prashantsomashekar commented on July 24, 2024 1

Hi. Just general hiding, but ya, it is nice to see what is occurring without resorting to extra flags at runtime, etc.

Thank you for the support.

from ansible-docker.

nickjj avatar nickjj commented on July 24, 2024

Hi,

Were you thinking of doing this with no_log: true on that task?

from ansible-docker.

prashantsomashekar avatar prashantsomashekar commented on July 24, 2024

Hi.

Yup.

Thank you.

from ansible-docker.

nickjj avatar nickjj commented on July 24, 2024

I just pushed af3e986 to the master branch which addresses this issue.

I ended up not using no_log: true. Instead it uses the loop_control.label feature which lets us customize what gets output. I chose to output the registry_url, username and the state which I think is enough information to see if Ansible logged you into the correct registry based on your inventory configuration.

Here's an example of what the output looks like now:

ok: [test] => (item={'registry_url': 'https://index.docker.io/v1/', 'username': 'exampleuser', 'state': 'present'})

Thanks a lot for opening this issue as it improved the security of the role!

from ansible-docker.

prashantsomashekar avatar prashantsomashekar commented on July 24, 2024

Hi. Please be aware that one can still see the PW using this method with verbose output.

from ansible-docker.

nickjj avatar nickjj commented on July 24, 2024

I believe the same can be said with no_log: true too.

from ansible-docker.

prashantsomashekar avatar prashantsomashekar commented on July 24, 2024

no_log suppresses all output (even with verbose).

'"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result",'

from ansible-docker.

nickjj avatar nickjj commented on July 24, 2024

no_log suppresses all output (even with verbose).

Yep but you can set ANSIBLE_DEBUG=1 and then no_log: true won't hide the output. It's the same idea that if a user can run ansible with -v then they can run ansible with ANSIBLE_DEBUG=1 to bypass no_log.

Did you mainly want to hide the output during CI logs? If so I much prefer the label approach because you get the extra detail of what registry is being logged into. This is also nice for standard usage on your Ansible controller no matter where it runs.

from ansible-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.