--- # 27 August, 2018: Not all OCP workshops have OPENTLC-PROJECT-PROVISIONERS group by default - name: create our own OPENTLC-PROJECT-PROVISIONERS command: "oc adm groups new OPENTLC-PROJECT-PROVISIONERS" ignore_errors: true - name: allow OPENTLC-PROJECT-PROVISIONERS members to provision their own projects command: "oc adm policy add-cluster-role-to-group self-provisioner OPENTLC-PROJECT-PROVISIONERS" ignore_errors: true - name: Add user to developer group (allowed to create projects) shell: "oc adm groups add-users {{item}} {{ocp_username}}" register: groupadd_register with_items: "{{ocp_user_groups}}" when: ocp_username is defined and ocp_user_groups is defined # - name: test that command worked # debug: # var: groupadd_register # verbosity: 2 - name: Create user Quota - clusterresourcequota shell: | oc create clusterquota clusterquota-"{{ocp_username}}-{{guid}}" \ --project-annotation-selector=openshift.io/requester="{{ocp_username}}" \ --hard requests.cpu="{{quota_requests_cpu}}" \ --hard limits.cpu="{{quota_limits_cpu}}" \ --hard requests.memory="{{quota_requests_memory}}" \ --hard limits.memory="{{quota_limits_memory}}" \ --hard configmaps="{{quota_configmaps}}" \ --hard pods="{{quota_pods}}" \ --hard persistentvolumeclaims="{{quota_persistentvolumeclaims}}" \ --hard services="{{quota_services}}" \ --hard secrets="{{quota_secrets}}" \ --hard requests.storage="{{quota_requests_storage}}" ignore_errors: true - name: pre_workload Tasks Complete debug: msg: "Pre-Software checks completed successfully"