<commit_before>---

- name: set crowbar_node_name fact
  set_fact:
    crowbar_node_name: "d{{ hostvars['ansible_%s' | format(admin_interface)].macaddress | replace(':', '-') }}.{{ cloud_fqdn }}"

- name: Reserve node admin IP addresses in Crowbar
  include_tasks: reserve_admin_ip.yml

- name: Remove existing repositories
  shell: |
    set -e
    while [ "`zypper lr | grep ^1`" != '' ]; do
      zypper rr 1
    done

- name: Run crowbar_register
  shell: |
    set -e

    wget {{ crowbar_register_url }} -O {{ crowbar_register_path }}
    chmod +x {{ crowbar_register_path }}

    SSH_CONNECTION= {{ crowbar_register_path }} -f --interface {{ admin_interface }} --gpg-auto-import-keys --no-gpg-checks 2>&1 | tee {{ crowbar_register_log }}
    exit ${PIPESTATUS[0]}

- name: Check that node has registered
  delegate_to: "{{ ardana_env }}"
  shell: knife node list | tr -d ' '
  register: _register_tmp
  failed_when: "_register_tmp.rc != 0 or crowbar_node_name not in _register_tmp.stdout_lines"

- name: Check that node is ready
  delegate_to: "{{ ardana_env }}"<commit_msg>openstack-crowbar: fix crowbar register role<commit_after>---

- name: set crowbar_node_name fact
  set_fact:
    crowbar_node_name: "d{{ hostvars[inventory_hostname]['ansible_%s' | format(admin_interface)].macaddress | replace(':', '-') }}.{{ cloud_fqdn }}"

- name: Reserve node admin IP addresses in Crowbar
  include_tasks: reserve_admin_ip.yml

- name: Remove existing repositories
  shell: |
    set -e
    while [ "`zypper lr | grep ^1`" != '' ]; do
      zypper rr 1
    done

- name: Run crowbar_register
  shell: |
    set -e

    wget {{ crowbar_register_url }} -O {{ crowbar_register_path }}
    chmod +x {{ crowbar_register_path }}

    SSH_CONNECTION= {{ crowbar_register_path }} -f --interface {{ admin_interface }} --gpg-auto-import-keys --no-gpg-checks 2>&1 | tee {{ crowbar_register_log }}
    exit ${PIPESTATUS[0]}

- name: Check that node has registered
  delegate_to: "{{ ardana_env }}"
  shell: knife node list | tr -d ' '
  register: _register_tmp
  failed_when: "_register_tmp.rc != 0 or crowbar_node_name not in _register_tmp.stdout_lines"

- name: Check that node is ready
  delegate_to: "{{ ardana_env }}"
{'fraction_non_alphanumeric': 0.13285133303208316, 'fraction_numerical': 0.005422503389064619, 'mean_word_length': 3.690677966101695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7488306', 'n_tokens_mistral': 789, 'n_tokens_neox': 758, 'n_words': 196}