-
Notifications
You must be signed in to change notification settings - Fork 7
feat: Automate Nautobot service account provisioning #1256
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
Conversation
3949238
to
dcb83db
Compare
b381149
to
1ba36c8
Compare
workflows/argo-events/eventsources/k8s-secret-nautobot-token.yaml
Outdated
Show resolved
Hide resolved
workflows/argo-events/serviceaccounts/k8s-secret-events-nautobot.yaml
Outdated
Show resolved
Hide resolved
workflows/argo-events/serviceaccounts/k8s-secret-events-nautobot.yaml
Outdated
Show resolved
Hide resolved
workflows/argo-events/serviceaccounts/k8s-secret-events-nautobot.yaml
Outdated
Show resolved
Hide resolved
workflows/argo-events/serviceaccounts/k8s-secret-events-nautobot.yaml
Outdated
Show resolved
Hide resolved
8beb45f
to
8fa7e24
Compare
50f6815
to
65edba4
Compare
65edba4
to
61964d6
Compare
This is looking good, but we need to document the flow using some flow chart + we need to have a table where all the required passwords are listed. |
61964d6
to
497260e
Compare
54871b8
to
1beab28
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, please rebase
875ed2e
to
912b22d
Compare
return None, f"Failed to fetch tokens: {e}" | ||
|
||
data = response.json() | ||
tokens = data.get("results", []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under what circumstance does the nautobot API produce 2xx responses with no "result" key in the body? Is it correct to interpret this as "query was successful and there are no tokens", or should this be treated as an error, indicating that the query could not be completed, and/or the results could not be parsed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for no tokens
{
"count": 0,
"next": null,
"previous": null,
"results": []
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that example the "results" key is present, with a value of the empty list. I was saying that if there is no "results" key at all in the dict, you treat this as the same thing, and I was wondering if that could mask errors from the API. However we are not worrying about errors, so you can ignore this.
912b22d
to
5e13341
Compare
5e13341
to
43387b5
Compare
So I'm still struggling to see the deployment configuration here. The questions I've got:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like Doug says, if this is going to run in each site, the credential in passwordsafe would list the "central" nautobot URL, and every site will try to create the user and token in the central nautobot.
Should each site have its own username, like argo.iad3, argo.rxdb-lab, and so on?
return None, f"Failed to fetch tokens: {e}" | ||
|
||
data = response.json() | ||
tokens = data.get("results", []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that example the "results" key is present, with a value of the empty list. I was saying that if there is no "results" key at all in the dict, you treat this as the same thing, and I was wondering if that could mask errors from the API. However we are not worrying about errors, so you can ignore this.
yes every site has its own set of secrets. |
43387b5
to
7dda85e
Compare
|
7dda85e
to
b395afb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's take one example: the secret that a site's argo-workflows is going to use, containing a token allowing it to log in to Nautobot. In which namespace will that be created?
How was that secret previously created? If it is managed by Argo CD, is there an old manifest that we need to delete?
|
b395afb
to
c59efea
Compare
When service account details are created in Vault (PasswordSafe), a Kubernetes secret is generated. Argo Events then triggers a Job that runs an Ansible playbook to ensure the user is created in Nautobot and a corresponding token is provisioned.
c59efea
to
a59a975
Compare
When service account details are created in Vault (PasswordSafe), a Kubernetes
secret is generated. Argo Events then triggers a Job that runs an Ansible
playbook to ensure the user is created in Nautobot and a corresponding token
is provisioned.