Skip to content

Commit

Permalink
ci: test another workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaser committed Sep 16, 2023
1 parent 3a20a45 commit 61e88a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
12 changes: 0 additions & 12 deletions molecule/shared/prepare/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@
workspace_path: "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}"
domain_name: "{{ (lookup('env', 'HOST_IP') | default(ansible_default_ipv4.address, true)).replace('.', '-') }}.{{ lookup('env', 'ATMOSPHERE_DNS_SUFFIX_NAME') | default('nip.io', True) }}" # noqa: yaml[line-length]

# NOTE(mnaser): Since we create the workspace in the same playbook, we need to
# load all of the variables (howver Ansible won't see them in
# this playbook), so we will loop over all the `group_vars` and
# use `include_vars` to load them.
- name: Workaround for https://github.com/ansible/ansible/issues/24987
hosts: all
gather_facts: false
tasks:
- name: Load group_vars
ansible.builtin.include_vars:
dir: "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}/group_vars"

- name: Prepare systems for test
hosts: all
become: true
Expand Down
19 changes: 16 additions & 3 deletions molecule/shared/prepare/kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@
# License for the specific language governing permissions and limitations
# under the License.

- ansible.builtin.import_playbook: vexxhost.atmosphere.kubernetes
# NOTE(mnaser): Since we create the workspace in the same playbook, we need to
# load all of the variables (howver Ansible won't see them in
# this playbook), so we will loop over all the `group_vars` and
# use `include_vars` to load them.
- name: Workaround for https://github.com/ansible/ansible/issues/24987
hosts: all
gather_facts: false
tasks:
- name: Load Kubernetes variables
ansible.builtin.include_vars:
file: "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}/group_vars/all/kubernetes.yml"

- name: Install Kubernetes
ansible.builtin.import_playbook: vexxhost.atmosphere.kubernetes

# NOTE(mnaser): When using Docker with custom networks, it will use 127.0.0.11
# as the DNS server which trips up the CoreDNS "loop" plugin.
Expand Down Expand Up @@ -56,9 +69,9 @@
- Wait for CoreDNS to be ready
handlers:
- name: Rollout CoreDNS
command: kubectl -n kube-system rollout restart deploy/coredns
ansible.builtin.command: kubectl -n kube-system rollout restart deploy/coredns
- name: Wait for CoreDNS to be ready
command: kubectl -n kube-system rollout status deploy/coredns
ansible.builtin.command: kubectl -n kube-system rollout status deploy/coredns

- ansible.builtin.import_playbook: vexxhost.atmosphere.csi

Expand Down

0 comments on commit 61e88a2

Please sign in to comment.