4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 shell: "ceph mon dump -f json"
20 register: get_ceph_mons
22 - name: parse mons command output
24 ceph_mons_dump: "{{ get_ceph_mons.stdout | from_json }}"
25 - name: assemble mons list string
27 ceph_mons_list: "{{ ceph_mons_dump.mons | map(attribute='addr') | join(',')}}"
29 - name: get auth tokens
31 ceph_admin_token: "{{ auth_tokens | selectattr('name', 'search', 'admin') | first }}"
32 ceph_user_token: "{{ auth_tokens | selectattr('name', 'search', 'caas') | first }}"
34 - name: template storage class manifets
36 src: ceph-storageclass.yaml.j2
37 dest: "{{ caas.manifests_directory }}/ceph-storageclass.yaml"
39 name: ceph-storage-class
42 - name: create kubernetes storage class
44 manifest: "{{ caas.manifests_directory }}/ceph-storageclass.yaml"
46 when: ( nodename | search("caas_master1") )