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

idrac_server_config_profile improvement requested (request) #137

Closed
ThierryBesancon opened this issue Aug 14, 2020 · 5 comments
Closed

idrac_server_config_profile improvement requested (request) #137

ThierryBesancon opened this issue Aug 14, 2020 · 5 comments
Labels
area/idrac idrac modules type/feature-request New feature or request

Comments

@ThierryBesancon
Copy link

ThierryBesancon commented Aug 14, 2020

Hello

When you export the server config profile with idrac_server_config_profile, you can not specify the destination file. You can provide a scp_file definition but it is silently ignored. When you read idrac_server_config_profile.py, you clearly see the parameter is ignored and the profile is always named ipaddr_YYYYmmdd_HHMMSS( extension .xml or .json). That makes the name quite unpredictable (especially as python ansible is quite slow). Image i want to export the scp as XML, do some xml trickery on it and then push it back with an import. Exporting to an unpredictable name makes like harder in ansible... (unless you have a magic trick to do that that you can share with us?)

So my request is: would it be possible for idrac_server_config_profile to export to ipadd_YYYYmmdd_HHMMSS by default (to stay compatible with previous releases) but honour scp_file when set? If the request is refused, please update the documentation not to be misleading as it is presently: specify that scp_file is only used for import and never for export.

Thanks in advance for your future comment on my request.

@ThierryBesancon ThierryBesancon changed the title idrac_server_config_profile improvement required idrac_server_config_profile improvement requested Aug 14, 2020
@ThierryBesancon ThierryBesancon changed the title idrac_server_config_profile improvement requested idrac_server_config_profile improvement requested (request) Aug 14, 2020
@anupamaloke anupamaloke added the type/feature-request New feature or request label Aug 17, 2020
@anupamaloke
Copy link
Contributor

anupamaloke commented Aug 17, 2020

@ThierryBesancon, thank you for submitting this feature request. While the team will triage this and add to our internal backlog for appropriate prioritization, in the meanwhile, I can think of the following workaround to achieve your workflow:

  vars:
    scp_file_name: "scp.xml"

  tasks:
    - name: Export SCP
      idrac_server_config_profile:
        idrac_ip: "{{ inventory_hostname }}"
        idrac_user: "{{ user }}"
        idrac_password: "{{ password }}"
        share_name: "{{ playbook_dir }}"
        export_use: "Clone"
        job_wait: True
      register: result

    - name: stat the exported scp file
      stat:
        path: "{{ result.scp_status.file }}"
      register: scp_stat
      delegate_to: localhost

    - name: Rename the scp file
      command: "mv {{ result.scp_status.file }} {{ scp_file_name }}"
      when: scp_stat.stat.exists
      delegate_to: localhost

@ThierryBesancon
Copy link
Author

Hello

Thanks for your workaround but as i use a NFS share, result.scp_status.file is something like share_name/ipaddr_YYYYmmdd_HHMMSS_scp.xml that's to say that share_name is for example 192.168.0.1:/some/path/to/my/nfs/share/. More ansible work on characters strings is needed to get the SCP to the name i would like. It is not that it can't be done but count the ansible lines to do so we have to add each time we want to export the SCP... I'll try to post you a python patch to idrac_server_config_profile.py.

Thierry

@anupamaloke
Copy link
Contributor

@ThierryBesancon, I agree that this becomes a little cumbersome when working with CIFS or NFS shares.

@jagadeeshnv
Copy link
Collaborator

@ThierryBesancon We have added this feature with the latest commit, where "scp_file" option can be used to specify custom file name. Kindly verify and let us know

@jagadeeshnv jagadeeshnv added the area/idrac idrac modules label Sep 23, 2020
@jagadeeshnv
Copy link
Collaborator

@ThierryBesancon This feature has been added with the latest commit. Hence closing issue. Thank you for the good suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/idrac idrac modules type/feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants