Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Always receive condition check error on Create the RKE2 etcd snapshot dir #121

Open
alexandershelega opened this issue Dec 1, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@alexandershelega
Copy link

alexandershelega commented Dec 1, 2022

Summary

When try to install rke2 cluster, receive error

i'm installing single server

[masters]

team-edge1-k8s
fatal: [team-edge1-k8s]: FAILED! => {"msg": "The conditional check 'rke2_etcd_snapshot_file and ( \"rke2-server.service\" is not in ansible_facts.services )' failed. The error was: template error while templating string: expected token ')', got '.'. String: {% if rke2_etcd_snapshot_file and ( \"rke2-server.service\" is not in ansible_facts.services ) %} True {% else %} False {% endif %}\n\nThe error appears to be in '/root/.ansible/roles/lablabs.rke2/tasks/first_server.yml': line 40, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n  block:\n    - name: Create the RKE2 etcd snapshot dir\n      ^ here\n"}

Issue Type

Bug Report

Ansible Version

ansible [core 2.12.10]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 2.10.1
  libyaml = True

Steps to Reproduce

- name: Deploy RKE2
  hosts: all
  become: yes
  vars:
    rke2_download_kubeconf: true
    rke2_interface: ens160
    rke2_version: v1.24.7+rke2r1
    rke2_disable: rke2-ingress-nginx
    rke2_airgap_mode: true
    rke2_airgap_implementation: copy
    rke2_artifact:
      - sha256sum-{{ rke2_architecture }}.txt
      - rke2.linux-{{ rke2_architecture }}.tar.gz
      - rke2-images.linux-{{ rke2_architecture }}.tar.zst
    rke2_custom_registry_mirrors:
      - name: docker.io
        endpoint:
         - 'https://harbor.intent.ai'
        rewrite: '"^rancher/(.*)": "harbor.int.ai/rancher/$1"'
  roles:
     - role: ansible-role-rke2

Expected Results

I expect clean installation but receive conditional check error

Actual Results

-edge1-k8s             : ok=14   changed=4    unreachable=0    failed=1    skipped=14   rescued=0    ignored=0
@alexandershelega alexandershelega added the bug Something isn't working label Dec 1, 2022
@ot-random1
Copy link

Hello @alexandershelega

I have added quotes to ansible_facts.services to get this passed. This seems not to be the best practice, but it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants