<commit_before>---
- name: Setup openstack repos
  hosts: openstack_nodes
  gather_facts: yes
  become: yes
  become_method: sudo
  roles:
      - role: installer/rhos-release
        rr_rpm_url: "{{ installer.product.rpm }}"
        core_version: "{{ installer.product.version }}"
        core_build: "{{ installer.product.build }}"
        mirror: "{{ installer.mirror | default(omit) }}"
  tasks:
      - name: Update all packages
        yum: name=* state=latest

- name: Ensure hostname is configured properly
  hosts: openstack_nodes
  gather_facts: yes
  become: yes
  become_method: sudo
  tasks:
    - name: Configure hostname
      hostname: name="{{ hostvars[inventory_hostname].inventory_hostname }}"

    - name: Ensure hostname is in /etc/hosts
      lineinfile:
        dest: /etc/hosts
        regexp: '.*{{ inventory_hostname }}$'
        line: "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }} {{inventory_hostname}}"
        state: present
      when: hostvars[inventory_hostname].ansible_default_ipv4.address is defined

    - name: restart systemd-hostnamed
      service: name=systemd-hostnamed state=restarted sleep=5
      when: ansible_distribution_version|int > 6

- name: Create ssh key if one does not exist
  hosts: controller
  gather_facts: no
  become: yes
  become_method: sudo
  tasks:
      - name: create key
        #this will not overwrite an existing key
        user: name=root generate_ssh_key=yes

      - name: fetch ssh-key generated from controller
        fetch: src=/root/.ssh/id_rsa.pub dest=/tmp/ssh_keys/ flat=yes fail_on_missing=yes<commit_msg>Packstack vnc console fix<commit_after>---
- name: Setup openstack repos
  hosts: openstack_nodes
  gather_facts: yes
  become: yes
  become_method: sudo
  roles:
      - role: installer/rhos-release
        rr_rpm_url: "{{ installer.product.rpm }}"
        core_version: "{{ installer.product.version }}"
        core_build: "{{ installer.product.build }}"
        mirror: "{{ installer.mirror | default(omit) }}"
  tasks:
      - name: Update all packages
        yum: name=* state=latest

- name: Ensure hostname is configured properly
  hosts: openstack_nodes
  gather_facts: yes
  become: yes
  become_method: sudo
  tasks:
    - name: Configure hostname
      hostname: name="{{ hostvars[inventory_hostname].inventory_hostname }}"

    - name: Gather updated facts after hostname configuration
      setup:

    - name: Ensure hostname is in /etc/hosts
      lineinfile:
        dest: /etc/hosts
        line: "{{ hostvars[item].ansible_default_ipv4.address }} {{ hostvars[item].facter_fqdn }} {{ hostvars[item].inventory_hostname }}"
        insertafter: EOF
        state: present
      with_items: "{{ groups['openstack_nodes'] }}"
      when: hostvars[inventory_hostname].ansible_default_ipv4.address is defined

    - name: restart systemd-hostnamed
      service: name=systemd-hostnamed state=restarted sleep=5
      when: ansible_distribution_version|int > 6

- name: Create ssh key if one does not exist
  hosts: controller
  gather_facts: no
  become: yes
  become_method: sudo
  tasks:
      - name: create key
        #this will not overwrite an existing key
        user: name=root generate_ssh_key=yes

      - name: fetch ssh-key generated from controller
        fetch: src=/root/.ssh/id_rsa.pub dest=/tmp/ssh_keys/ flat=yes fail_on_missing=yes
{'fraction_non_alphanumeric': 0.09985185185185186, 'fraction_numerical': 0.0023703703703703703, 'mean_word_length': 3.1020656136087483, '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': '6524260', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1049, 'n_words': 265}