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

[FEATURE REQUEST] citrixadc_systemfile support overwrite #1119

Open
ravager-dk opened this issue Feb 2, 2024 · 0 comments
Open

[FEATURE REQUEST] citrixadc_systemfile support overwrite #1119

ravager-dk opened this issue Feb 2, 2024 · 0 comments
Assignees

Comments

@ravager-dk
Copy link
Contributor

Contact us

For any immediate issues or help , reach out to us at NetScaler-AutomationToolkit@cloud.com !

Feature Request

Is your feature request related to a problem? Please describe.
I am trying to use citrixadc_systemfile to upload a custom sshd_config file to /etc/sshd_config after initial vpx deployment. However since the file already exists I get error:
Error: [0m Error: [ERROR] nitro-go: Failed to create resource of type systemfile, name=, err=failed: 409 Conflict ({ "errorcode": 1642, "message": "Cannot create output file. File already exists", "severity": "ERROR" })

Describe the solution you'd like
A simple bool argument called overwrite_existing allowing overwriting the existing file. I am not sure if the NITRO api allows for this, since I have not tested it. But look at the following link it seems there is an override query that could be what would work:
https://developer-docs.netscaler.com/en-us/adc-nitro-api/current-release/configuration/system/systemfile.html#add
Alternatively it could be wrapped in a delete call (continuing on error if the file does NOT exist) and an add call.

Describe alternatives you've considered
Tried importing the file first, but first of all this gives an error (I will create a separate issue for that), and secondly this does not work well in a fully automated solution. I should not have to break the workflow up after deployment, import the file into state and then run the rest of the config workflow.

Additional context
Code for reproducing. Just add any text to a sshd_config file in the workspace:
resource "citrixadc_systemfile" "sshd_config" {
filename = "sshd_config"
filelocation = "/etc"
filecontent = file("${path.module}/sshd_config")
}

@rohit-myali rohit-myali self-assigned this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants