-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add image-auditor role to ManageIQ SA #1737
Add image-auditor role to ManageIQ SA #1737
Conversation
Can one of the admins verify this patch? |
Can one of the admins verify this patch?
|
Is there anything else it needs? |
Opened openshift/origin#8455. Please comment on necessary permissions there. |
@@ -27,6 +27,7 @@ manage_iq_tasks: | |||
- policy add-role-to-user -n management-infra admin -z management-admin | |||
- policy add-role-to-user -n management-infra management-infra-admin -z management-admin | |||
- policy add-cluster-role-to-user cluster-reader system:serviceaccount:management-infra:management-admin | |||
- policy add-cluster-role-to-user image-auditor system:serviceaccount:management-infra:management-admin |
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.
This role will need to be conditionalized on openshift.common.version_gte_3_2_or_1_2
since the role doesn't exist prior to that.
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.
This role will need to be conditionalized on openshift.common.version_gte_3_2_or_1_2 since the role doesn't exist prior to that.
@detiber During testing the upgrade scenario I installed with openshift_pkg_version=-1.2.0
after first installing with openshift_pkg_version=-1.1.6
and found out the role does not exist there:
[root@mtayer-centos7-4 ~]# oc version
oc v1.2.0-rc1
kubernetes v1.2.0-36-g4a3f9c5
[root@mtayer-centos7-4 ~]# oc get clusterrole/system:image-auditor
Error from server: role "system:image-auditor" not found
I can not explain this since when I installed regularly (not upgrade) there was no problem
This will require adding the new role to the 3.2 upgrade in |
@moolitayer what's up with this one? It's required ASAP. |
@detiber I'm new to openshift-ansible / ansible. I see that v3_1_to_v3_2/roles links to root roles: ls -ltr playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/roles
lrwxrwxrwx. 1 mtayer mtayer 20 Apr 10 16:46 playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/roles -> ../../../../../roles
$ grep manage_iq_openshift_3_2_tasks playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/roles/openshift_manageiq/vars/main.yml # The var I added
manage_iq_openshift_3_2_tasks: Will that take care of the upgrade scenario? |
3f38248
to
0187b30
Compare
Address comment from @detiber regarding openshift.common.version_gte_3_2_or_1_2 |
with_items: "{{manage_iq_openshift_3_2_tasks}}" | ||
register: osmiq_perm_3_2_task | ||
failed_when: osmiq_perm_3_2_task.rc != 0 | ||
changed_when: osmiq_perm_3_2_task.rc == 0 |
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.
@detiber @deads2k The above is wrong as it state changed even if the role existed but I could not think of anything better:
oadm policy does not tell me if the role existed (exit code for both cases is 0 and no output)
The only thing I could think of is parsing the result of
oc describe clusterPolicyBindings :default
but that does not feel right
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.
you might be able to use oc get clusterpolicybindings system:image-auditor
with the --template
argument to return just the user field. I would have to defer to @abutcher or @deads2k on the syntax for that though.
You might also want to consider passing -o yaml
or -o json
and then you could use the from_yaml
or from_json
filter to better interact with the return value as well.
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.
oc get clusterpolicybindings system:image-auditor
does not seem to work for me with
Error from server: clusterpolicybinding "system:image-auditor" not found
@deads2k @abutcher is there currently a way to get this info?
https://trello.com/c/YqfYqKdS/545-8-policy-related-endpoints-need-work seems to be related
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.
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.
oc get clusterrole/system:image-auditor
Does this not only tell me that the role exists? I need to know if it is associated to the serviceAccounts management-infra/management-admin
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.
Does this not only tell me that the role exists? I need to know if it is associated to the serviceAccounts management-infra/management-admin
Why don't you just unconditionally bind it? The operation should be idempotent: oadm policy add-cluster-role-to-user
.
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.
Why don't you just unconditionally bind it? The operation should be idempotent: oadm policy add-cluster-role-to-user.
Yes I am. Question is what to use for changed_when
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.
Yes I am. Question is what to use for changed_when
I don't know what change_when is. You can get the binding using oc get clusterpolicybinding
(no name arg). It will list them all (should only be one) and you can search for your item. It will be painful.
We don't guarantee rolebinding names, but oc get clusterrolebinding/<find your name>
would probably be pretty stable.
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.
@deads2k changed_when is an ansible construct that describes to ansible when to determine if the task should be labeled as 'changed' or 'ok' when run. We would want to only mark it as 'changed' if we are adding the rolebinding and not for all future iterations through the task
@sdodson ptal |
@sdodson ping? |
@moolitayer for the ugprade scenario I think you can get by with simply adding this role to the list of roles to re-run during upgrades, this looks completely idempotent. Add the following after line 12 https://github.com/openshift/openshift-ansible/blob/master/playbooks/common/openshift-cluster/upgrades/v3_1_to_v3_2/post.yml#L12 |
0187b30
to
cb6ff8a
Compare
@abutcher @detiber @sdodson could someone please direct me to how to run upgrades with openshift-ansible to test the upgrade scenario? I've tried following https://docs.openshift.com/enterprise/3.0/install_config/upgrades.html but it seems out of date since playbooks/adhoc/upgrades/upgrade.yml does not exists. Updated instructions somewhere? |
You're concerned with v3.1 -> v3.2 only, correct?
3.2 docs haven't been published yet but these should still be relevant, just substitute v3_1_to_v3_2. |
@sdodson Thank you. AFAIK this is ready, besides if more attention is needed on the changed_when issue - if so Is grep the direction? (there is no better option I am aware of) [1]
then removed
|
@moolitayer unfortunately, I think we do need to solve the changed_when issue. I'm fine with ls | grep if that is the only way currently. |
@detiber given that existing code uses |
@moolitayer that's fine. |
ok to test |
aos-ci-test |
cb6ff8a - State: success - Test Context: aos-ci-jenkins/OS_unit_tests - Test Description: all unit tests passed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-pre-test-501/cb6ff8aa226e3013b5c258f1f05d921c78238717.txt |
cb6ff8a - State: error - Test Context: aos-ci-jenkins/OS_3.1_containerized - Test Description: openshift-ansible install failed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-openshift-ansible-906/cb6ff8aa226e3013b5c258f1f05d921c78238717.txt |
aos-ci-test |
6d55d92 - State: success - Test Context: aos-ci-jenkins/OS_unit_tests - Test Description: all unit tests passed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-pre-test-531/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
6d55d92 - State: error - Test Context: aos-ci-jenkins/OS_3.1_containerized - Test Description: openshift-ansible install failed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-openshift-ansible-969/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
6d55d92 - State: success - Test Context: aos-ci-jenkins/OS_3.1_NOT_containerized - Test Description: openshift-ansible install passed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-openshift-ansible-970/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
6d55d92 - State: success - Test Context: aos-ci-jenkins/OS_3.0_NOT_containerized - Test Description: openshift-ansible install passed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-openshift-ansible-971/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
6d55d92 - State: success - Test Context: aos-ci-jenkins/OS_3.1_NOT_containerized_e2e_tests - Test Description: all e2e tests passed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-e2e-tests-341/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
@sdodson any luck tracking down the version test issues? |
@sdodson Thanks! |
Ping @moolitayer |
aos-ci-test |
6d55d92 - State: success - Test Context: aos-ci-jenkins/OS_unit_tests - Test Description: all unit tests passed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-pre-test-566/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
6d55d92 - State: error - Test Context: aos-ci-jenkins/OS_3.0_NOT_containerized - Test Description: openshift-ansible install failed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-openshift-ansible-1060/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
6d55d92 - State: error - Test Context: aos-ci-jenkins/OS_3.1_containerized - Test Description: openshift-ansible install failed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-openshift-ansible-1061/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
6d55d92 - State: error - Test Context: aos-ci-jenkins/OS_3.1_NOT_containerized - Test Description: openshift-ansible install failed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-openshift-ansible-1062/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
aos-ci-test |
6d55d92 - State: success - Test Context: aos-ci-jenkins/OS_unit_tests - Test Description: all unit tests passed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-pre-test-574/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
6d55d92 - State: success - Test Context: aos-ci-jenkins/OS_3.0_NOT_containerized - Test Description: openshift-ansible install passed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-openshift-ansible-1084/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
6d55d92 - State: success - Test Context: aos-ci-jenkins/OS_3.1_containerized - Test Description: openshift-ansible install passed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-openshift-ansible-1085/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
6d55d92 - State: success - Test Context: aos-ci-jenkins/OS_3.1_NOT_containerized - Test Description: openshift-ansible install passed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-openshift-ansible-1086/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
6d55d92 - State: success - Test Context: aos-ci-jenkins/OS_3.1_containerized_e2e_tests - Test Description: all e2e tests passed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-e2e-tests-386/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
6d55d92 - State: success - Test Context: aos-ci-jenkins/OS_3.1_NOT_containerized_e2e_tests - Test Description: all e2e tests passed - Logs: https://aos-ci.s3.amazonaws.com/openshift/openshift-ansible/jenkins-openshift-ansible-run-e2e-tests-385/6d55d92799f40a0f2b9c67ef89802deed22ea34e.txt |
Has anyone seen this before? Note this is a re-run of openshift-ansible on top of an existing install (3.2.0.15).
|
@jeremyeder I saw this w/ some of the earlier 3.2 packages and @sdodson told me not to mess with anything less than 3.2.0.20. |
Was 3.2.0.15 ever released externally, or is it an internal only build? |
Okay, understood. Jason: Internal only afaik.
|
Based on: openshift/origin#8455