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

parameters: add option "hidden" to parameters to not show values in gui #1024

Open
1 of 4 tasks
fgoebel opened this issue Oct 14, 2020 · 5 comments
Open
1 of 4 tasks

Comments

@fgoebel
Copy link

fgoebel commented Oct 14, 2020

  • global_parameter
  • smart_class_parameter
  • nested parameter (org, loc)
  • domain, subnet, host, hostgroup, ... ("direct" params, for the lack of a better name)
SUMMARY

When I set parameters with these modules (global_parameters, organizations, locations,...) it is not possible to toggle the "hidden" option like in the gui.

# task example:
- theforeman.foreman.location:
    username: "{{ foreman_web_user }}"
    password: "{{ foreman_web_password }}"
    server_url: "{{ foreman_server }}"
    name: "some location"
    organizations:
    - "some Org"
    state: present
    parameters:
      - name: password
        parameter_type: string
        value: verySecretPasswordIdoNotWantToShowInGui
        hidden: true

What do you think?

ISSUE TYPE
  • Feature Idea
@mdellweg mdellweg added easy Good opportunity to start contributing enhancement feature request labels Oct 15, 2020
@mdellweg
Copy link
Member

At least for global_parameter this should be fairly easy to implement.
Do you want to give it a try?

@mdellweg
Copy link
Member

Oh, i went ahead, and did some experiments. Turns out, that hidden values are also hidden from the api. So creating a hidden parameter will not be idempotent. Also hidden_value is reported as hidden_value? by the API. This needs a little bit more designing.

https://theforeman.org/api/2.1/apidoc/v2/common_parameters/show.html

mdellweg added a commit to mdellweg/foreman-ansible-modules that referenced this issue Oct 16, 2020
mdellweg added a commit to mdellweg/foreman-ansible-modules that referenced this issue Oct 16, 2020
@mdellweg mdellweg removed the easy Good opportunity to start contributing label Oct 16, 2020
mdellweg added a commit to mdellweg/foreman-ansible-modules that referenced this issue Oct 16, 2020
mdellweg added a commit to mdellweg/foreman-ansible-modules that referenced this issue Oct 16, 2020
@fgoebel
Copy link
Author

fgoebel commented Oct 19, 2020

hey mdellweg,
thank you for your first test and your answer to my feature request.

I have never done any development yet, so i think i can barely help with this.
But if you would maybe assist me, I am happy to test your changes and maybe get some development started this way!

@mdellweg
Copy link
Member

I removed the "easy" label, because the thing is a bit tricky. We are in the process of pushing a breaking change through apypie to solve this. But, i invite you to test my PR #1025 .

mdellweg added a commit to mdellweg/foreman-ansible-modules that referenced this issue Oct 19, 2020
@evgeni
Copy link
Member

evgeni commented Oct 19, 2020

#1025 is now merged.

while reviewing it, we noticed that smart_class_parameter has partial support for hidden parameters already, but is missing the idempotency bit that @mdellweg implemented for global_parameter in #1025

and this still needs porting to the other parameter handlers we have (yay)

@evgeni evgeni added the triaged label Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants