diff options
author | Matt Woodson <mwoodson@gmail.com> | 2016-01-11 11:00:40 -0500 |
---|---|---|
committer | Matt Woodson <mwoodson@gmail.com> | 2016-01-11 11:00:40 -0500 |
commit | 0bbfef4e1951db1f19135e532f78fe12cab6d4fc (patch) | |
tree | c01a390c68d29bd8b6b7a29db794b594bfa11216 /roles/openshift_serviceaccounts/tasks | |
parent | c607f1ba93be5e9f16723074ff97ffd27b025f8c (diff) | |
parent | 2dc56faff5812ba436bffd2fcd3ec2ac57780286 (diff) | |
download | openshift-0bbfef4e1951db1f19135e532f78fe12cab6d4fc.tar.gz openshift-0bbfef4e1951db1f19135e532f78fe12cab6d4fc.tar.bz2 openshift-0bbfef4e1951db1f19135e532f78fe12cab6d4fc.tar.xz openshift-0bbfef4e1951db1f19135e532f78fe12cab6d4fc.zip |
Merge pull request #1155 from mwoodson/host_monitoring
merging master into prod
Diffstat (limited to 'roles/openshift_serviceaccounts/tasks')
-rw-r--r-- | roles/openshift_serviceaccounts/tasks/main.yml | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/roles/openshift_serviceaccounts/tasks/main.yml b/roles/openshift_serviceaccounts/tasks/main.yml index e558a83a2..4c7faa6fe 100644 --- a/roles/openshift_serviceaccounts/tasks/main.yml +++ b/roles/openshift_serviceaccounts/tasks/main.yml @@ -1,12 +1,19 @@ +- name: tmp dir for openshift + file: + path: /tmp/openshift + state: directory + owner: root + mode: 700 + - name: Create service account configs template: src: serviceaccount.j2 - dest: "/tmp/{{ item }}-serviceaccount.yaml" + dest: "/tmp/openshift/{{ item }}-serviceaccount.yaml" with_items: accounts - name: Create {{ item }} service account command: > - {{ openshift.common.client_binary }} create -f "/tmp/{{ item }}-serviceaccount.yaml" + {{ openshift.common.client_binary }} create -f "/tmp/openshift/{{ item }}-serviceaccount.yaml" with_items: accounts register: _sa_result failed_when: "'serviceaccounts \"{{ item }}\" already exists' not in _sa_result.stderr and _sa_result.rc != 0" @@ -15,14 +22,15 @@ - name: Get current security context constraints shell: > {{ openshift.common.client_binary }} get scc privileged -o yaml - --output-version=v1 > /tmp/scc.yaml + --output-version=v1 > /tmp/openshift/scc.yaml + changed_when: false - name: Add security context constraint for {{ item }} lineinfile: - dest: /tmp/scc.yaml + dest: /tmp/openshift/scc.yaml line: "- system:serviceaccount:default:{{ item }}" insertafter: "^users:$" with_items: accounts - name: Apply new scc rules for service accounts - command: "{{ openshift.common.client_binary }} update -f /tmp/scc.yaml --api-version=v1" + command: "{{ openshift.common.client_binary }} update -f /tmp/openshift/scc.yaml --api-version=v1" |