<commit_before>---
- include: novnc.yml
  when: openstack_install_method != 'distro'
  tags: novnc

- name: set uwsgi path (source install)
  set_fact: nova_uwsgi_path={{ openstack_source.virtualenv_base }}/nova/bin/uwsgi
  when: openstack_install_method == 'source'

- name: set uwsgi path (package install ubuntu)
  set_fact:
    nova_uwsgi_path: "{{ openstack_package.virtualenv_base }}/nova/bin/uwsgi"
  when: openstack_install_method == 'package' and ursula_os == 'ubuntu'

- name: set uwsgi path (package install rhel)
  set_fact:
    nova_uwsgi_path: "/usr/sbin/uwsgi"
  when: openstack_install_method == 'distro'

- name: Create nova placement api uwsgi and config directories
  file: path={{ item }} state=directory
        owner=nova group=nova mode=0775
  with_items:
    - /etc/nova/uwsgi
    - /run/uwsgi/nova

- name: configure nova placement api wsgi
  template: src=etc/nova/uwsgi/placement.ini
            dest=/etc/nova/uwsgi/placement.ini mode=0775
            owner=nova group=nova

- name: remove nova placement api apache conf (rhel)
  file:
    dest: /etc/httpd/conf.d/00-nova-placement-api.conf
    state: absent
  failed_when: false
  when: openstack_install_method == 'distro'

- block:
  - name: remove retired nova controller services (ubuntu)
    upstart_service:
      name: "{{ item.name }}"
      user: "{{ item.user }}"
      cmd: "{{ item.cmd }}"
      config_dirs: "{{ item.config_dirs }}"
      state: "{{ item.state }}"
    with_items:
      - "{{ nova.services.nova_cert }}"

  - name: get nova-cert service ids
    shell: . /root/stackrc; nova service-list --binary nova-cert | grep nova-cert | awk '{print $2}'
    register: nova_cert_srvc_ids
    failed_when: false

  - name: remove retired nova-cert from nova service
    shell: . /root/stackrc; nova service-delete {{ item }}
    with_items: "{{ nova_cert_srvc_ids.stdout_lines }}"

  - name: install nova controller services (ubuntu)
    upstart_service:
      name: "{{ item.name }}"
      user: "{{ item.user }}"
      cmd: "{{ item.cmd }}"
      config_dirs: "{{ item.config_dirs }}"
    with_items:
      - "{{ nova.services.nova_api }}"
      - "{{ nova.services.nova_conductor }}"
      - "{{ nova.services.nova_consoleauth }}"
      - "{{ nova.services.nova_scheduler }}"
      - "{{ nova.services.nova_novncproxy }}"

  - name: install nova placement api uwsgi service (ubuntu)
    template: src=etc/init/nova-placement-api.conf
              dest=/etc/init/nova-placement-api.conf mode=0644
  when: ursula_os == 'ubuntu'

- block:
  - name: remove retired nova controller services (rhel)
    systemd_service:
      name: "{{ item.name }}"
      cmd: "{{ item.cmd }}"
      state: "{{ item.state }}"<commit_msg>add run_once for removing nova-cert service.<commit_after>---
- include: novnc.yml
  when: openstack_install_method != 'distro'
  tags: novnc

- name: set uwsgi path (source install)
  set_fact: nova_uwsgi_path={{ openstack_source.virtualenv_base }}/nova/bin/uwsgi
  when: openstack_install_method == 'source'

- name: set uwsgi path (package install ubuntu)
  set_fact:
    nova_uwsgi_path: "{{ openstack_package.virtualenv_base }}/nova/bin/uwsgi"
  when: openstack_install_method == 'package' and ursula_os == 'ubuntu'

- name: set uwsgi path (package install rhel)
  set_fact:
    nova_uwsgi_path: "/usr/sbin/uwsgi"
  when: openstack_install_method == 'distro'

- name: Create nova placement api uwsgi and config directories
  file: path={{ item }} state=directory
        owner=nova group=nova mode=0775
  with_items:
    - /etc/nova/uwsgi
    - /run/uwsgi/nova

- name: configure nova placement api wsgi
  template: src=etc/nova/uwsgi/placement.ini
            dest=/etc/nova/uwsgi/placement.ini mode=0775
            owner=nova group=nova

- name: remove nova placement api apache conf (rhel)
  file:
    dest: /etc/httpd/conf.d/00-nova-placement-api.conf
    state: absent
  failed_when: false
  when: openstack_install_method == 'distro'

- block:
  - name: remove retired nova controller services (ubuntu)
    upstart_service:
      name: "{{ item.name }}"
      user: "{{ item.user }}"
      cmd: "{{ item.cmd }}"
      config_dirs: "{{ item.config_dirs }}"
      state: "{{ item.state }}"
    with_items:
      - "{{ nova.services.nova_cert }}"

  - name: get nova-cert service ids
    shell: . /root/stackrc; nova service-list --binary nova-cert | grep nova-cert | awk '{print $2}'
    run_once: true
    register: nova_cert_srvc_ids
    failed_when: false
    changed_when: false

  - name: remove retired nova-cert from nova service
    shell: . /root/stackrc; nova service-delete {{ item }}
    with_items: "{{ nova_cert_srvc_ids.stdout_lines }}"
    run_once: true

  - name: install nova controller services (ubuntu)
    upstart_service:
      name: "{{ item.name }}"
      user: "{{ item.user }}"
      cmd: "{{ item.cmd }}"
      config_dirs: "{{ item.config_dirs }}"
    with_items:
      - "{{ nova.services.nova_api }}"
      - "{{ nova.services.nova_conductor }}"
      - "{{ nova.services.nova_consoleauth }}"
      - "{{ nova.services.nova_scheduler }}"
      - "{{ nova.services.nova_novncproxy }}"

  - name: install nova placement api uwsgi service (ubuntu)
    template: src=etc/init/nova-placement-api.conf
              dest=/etc/init/nova-placement-api.conf mode=0644
  when: ursula_os == 'ubuntu'

- block:
  - name: remove retired nova controller services (rhel)
    systemd_service:
      name: "{{ item.name }}"
      cmd: "{{ item.cmd }}"
      state: "{{ item.state }}"
{'fraction_non_alphanumeric': 0.1360260822314798, 'fraction_numerical': 0.005433798224959247, 'mean_word_length': 3.0483870967741935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5608629', 'n_tokens_mistral': 2014, 'n_tokens_neox': 1953, 'n_words': 423}