<commit_before>---
- hosts: cream-ces
  name: Deploy CREAM CE and dependencies
  user: ansible
  sudo: true
  vars_files:
    - roles/common/vars/distros/{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml
    - roles/common/vars/middleware/IGTF.yml
  pre_tasks:
    - name: Announce the play via Slack
      action:
        module: slack
        domain: africa-arabia-roc.slack.com
        token: <KEY>
        msg: "Running CREAM-CEs play on {{ inventory_hostname }} at {{ site_name }}"
        channel: "#devopssite"
        username: "Ansible on {{ inventory_hostname }}"
        #icon_url: "http://www.example.com/some-image-file.png"
        link_names: 1
        parse: 'full'
  roles:
  - common
  - certificates
  - umd
  - cream-ce
  handlers:
  - include: roles/common/handlers/main.yml
  post_tasks:
  - name: Announce the play outcome
    action:
      module: slack
      domain: africa-arabia-roc.slack.com
      token: <KEY>
      msg: "CREAM-CE play on {{ inventory_hostname }} at {{ site_name }} has completed until the CREAM-CE role"
      channel: "#devopssite"
      username: "Ansible on {{ inventory_hostname }}"
      link_names: 1
      parse: 'full'

- hosts: worker-nodes
  name: look up the IP addresses of the hosts
  tasks:
    - name: look up worker-node facts
      action: setup

- hosts: cream-ces
  name: Configure as head node
  user: ansible
  sudo: true
  roles:
   - munge
   - head-node

# Head node has to be run after you've configured all of the worker nodes, else the facts are not available.

- hosts: cream-ces
  name: run YAIM for CREAM-CE on head node
  user: ansible
  sudo: true
  pre_tasks:
  - name: Announce the play via Slack
    action:
      module: slack
      domain: africa-arabia-roc.slack.com
      token: <KEY>
      msg: "Running YAIM play on {{ inventory_hostname }} at {{ site_name }}"
      channel: "#devopssite"
      username: "Ansible on {{ inventory_hostname }}"
      #icon_url: "http://www.example.com/some-image-file.png"
      link_names: 1
      parse: 'full'
  roles:
  - yaim
  vars_files:
    - group_vars/passwords-{{ site_name }}.yml
  post_tasks:
    - name: Restart trqauthd
      sudo: true
      service: name=trqauthd state=started

    - name: fix qmgr queues 1
      sudo: true
      action: raw /usr/bin/qmgr -c "unset queue {{ item.name }} {{ resources_max.cput }}"
      with_items: qmgr_queues
      notify:
        - restart pbs_server

    - name: fix qmgr queues 2
      sudo: true
      action: raw /usr/bin/qmgr -c "set queue {{ item.name }} resources_max.walltime = {{ item.max_wall_time }}"
      with_items: qmgr_queues
      notify:
        - restart pbs_server

    - name: fix qmgr queues 3
      action: raw /usr/bin/qmgr -c "set queue {{ item.name }} resources_default.walltime = {{ item.max_wall_time }}"
      sudo: true
      with_items:
        - qmgr_queues
      notify:
        - restart pbs_server

    - name: fix Proxy_to_sandbox_dir
      sudo: true
      action: copy src=config/files/usr/bin/glite-cream-copyProxyToSandboxDir.sh dest=/usr/bin/glite-cream-copyProxyToSandboxDir.sh owner=root  group=root mode=755
<commit_msg>changed the name of the post tasks to describe better what they do<commit_after>---
- hosts: cream-ces
  name: Deploy CREAM CE and dependencies
  user: ansible
  sudo: true
  vars_files:
    - roles/common/vars/distros/{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml
    - roles/common/vars/middleware/IGTF.yml
  pre_tasks:
    - name: Announce the play via Slack
      action:
        module: slack
        domain: africa-arabia-roc.slack.com
        token: <KEY>
        msg: "Running CREAM-CEs play on {{ inventory_hostname }} at {{ site_name }}"
        channel: "#devopssite"
        username: "Ansible on {{ inventory_hostname }}"
        #icon_url: "http://www.example.com/some-image-file.png"
        link_names: 1
        parse: 'full'
  roles:
  - common
  - certificates
  - umd
  - cream-ce
  handlers:
  - include: roles/common/handlers/main.yml
  post_tasks:
  - name: Announce the play outcome
    action:
      module: slack
      domain: africa-arabia-roc.slack.com
      token: <KEY>
      msg: "CREAM-CE play on {{ inventory_hostname }} at {{ site_name }} has completed until the CREAM-CE role"
      channel: "#devopssite"
      username: "Ansible on {{ inventory_hostname }}"
      link_names: 1
      parse: 'full'

- hosts: worker-nodes
  name: look up the IP addresses of the hosts
  tasks:
    - name: look up worker-node facts
      action: setup

- hosts: cream-ces
  name: Configure as head node
  user: ansible
  sudo: true
  roles:
   - munge
   - head-node

# Head node has to be run after you've configured all of the worker nodes, else the facts are not available.

- hosts: cream-ces
  name: run YAIM for CREAM-CE on head node
  user: ansible
  sudo: true
  pre_tasks:
  - name: Announce the play via Slack
    action:
      module: slack
      domain: africa-arabia-roc.slack.com
      token: <KEY>
      msg: "Running YAIM play on {{ inventory_hostname }} at {{ site_name }}"
      channel: "#devopssite"
      username: "Ansible on {{ inventory_hostname }}"
      #icon_url: "http://www.example.com/some-image-file.png"
      link_names: 1
      parse: 'full'
  roles:
  - yaim
  vars_files:
    - group_vars/passwords-{{ site_name }}.yml
  post_tasks:
    - name: Restart trqauthd
      sudo: true
      service: name=trqauthd state=started

    - name: Remove queue CPU time limits
      sudo: true
      action: raw /usr/bin/qmgr -c "unset queue {{ item.name }} resources_max.cput"
      with_items: qmgr_queues
      notify:
        - restart pbs_server

    - name: Set Max Walltime limits
      sudo: true
      action: raw /usr/bin/qmgr -c "set queue {{ item.name }} resources_max.walltime = {{ item.max_wall_time }}"
      with_items: qmgr_queues
      notify:
        - restart pbs_server

    - name: Set Queue default walltime
      action: raw /usr/bin/qmgr -c "set queue {{ item.name }} resources_default.walltime = {{ item.max_wall_time }}"
      sudo: true
      with_items:
        - qmgr_queues
      notify:
        - restart pbs_server

    - name: fix Proxy_to_sandbox_dir
      sudo: true
      action: copy src=config/files/usr/bin/glite-cream-copyProxyToSandboxDir.sh dest=/usr/bin/glite-cream-copyProxyToSandboxDir.sh owner=root  group=root mode=755

{'fraction_non_alphanumeric': 0.10493343774471417, 'fraction_numerical': 0.0023492560689115116, 'mean_word_length': 2.50109649122807, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '7351475', 'n_tokens_mistral': 2176, 'n_tokens_neox': 2133, 'n_words': 587}