--- # Copyright Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. - name: Deploy Tofu hosts: "{{ cifmw_tofu_hosts_pattern | default('localhost') }}" gather_facts: true run_once: true tasks: - name: Create openstack config dir ansible.builtin.file: path: "{{ ansible_user_dir }}/.config/openstack/" owner: "{{ ansible_user_id }}" group: "{{ ansible_user_id }}" mode: '0744' state: directory - name: Fetch cloud config to host when: cifmw_tofu_fetch_cloud_config | default(true) | bool kubernetes.core.k8s_cp: kubeconfig: "{{ cifmw_tofu_kubeconfig }}" namespace: "{{ cifmw_openstack_namespace }}" pod: openstackclient remote_path: /home/cloud-admin/.config/openstack/ local_path: "{{ ansible_user_dir }}/.config/openstack/" state: from_pod - name: Deploy Tufo Environment ansible.builtin.import_role: name: tofu