<commit_before>---

- name: 'link bash to rbash'
  become: yes
  file: src=/bin/bash dest=/bin/rbash owner=root group=root state=hard

- name: 'restricted shell for ansible user'
  become: yes
  user: name={{ ansible_user }} shell=/bin/rbash

- name: 'install python packages'
  become: yes
  yum: name={{ item }} state=installed
  with_items:
    - python-virtualenv
    - python-pip

- name: 'copy requirements'
  copy: src=requirements.txt dest=/tmp/requirements.txt

- name: 'create virtualenv'
  pip: requirements=/tmp/requirements.txt virtualenv=/home/{{ansible_user}} virtualenv_site_packages=yes

- name: 'set permissions virtualenv'
  become: yes
  command: chmod -R go+rx /home/{{ansible_user}}

- name: 'copy tools'
  become: yes
  command: cp {{ item }} /home/{{ansible_user}}/bin
  with_items:
    - /bin/mkdir
    - /bin/echo
    - /bin/rm

- name: 'copy sh'
  become: yes
  command: cp /bin/sh /home/{{ansible_user}}/bin/sh creates=/home/{{ansible_user}}/bin/sh

- name: 'set permissions'
  become: yes
  shell: chmod go+rx /home/{{ ansible_user }}/bin/{{ item }}
  with_items:
    - mkdir
    - echo
    - rm
    - sh

- name: 'copy sudo'
  become: yes
  command: cp /usr/bin/sudo /home/{{ansible_user}}/bin/sudo creates=/home/{{ansible_user}}/bin/sudo

- name: 'set suid on sudo'
  become: yes
  file: path=/home/{{ ansible_user }}/bin/sudo mode=4111 owner=root group=root

- name: 'create bashrc'
  template: src=bashrc.j2 dest=/home/{{ansible_user}}/.bashrc mode=0400

- name: 'make sure ansible_user is for non-interactive use'
  copy: src=bash_profile
            dest=/home/{{ ansible_user }}/.bash_profile<commit_msg>add a few tools<commit_after>---

- name: 'link bash to rbash'
  become: yes
  file: src=/bin/bash dest=/bin/rbash owner=root group=root state=hard

- name: 'restricted shell for ansible user'
  become: yes
  user: name={{ ansible_user }} shell=/bin/rbash

- name: 'install python packages'
  become: yes
  yum: name={{ item }} state=installed
  with_items:
    - python-virtualenv
    - python-pip

- name: 'copy requirements'
  copy: src=requirements.txt dest=/tmp/requirements.txt

- name: 'create virtualenv'
  pip: requirements=/tmp/requirements.txt virtualenv=/home/{{ansible_user}} virtualenv_site_packages=yes

- name: 'set permissions virtualenv'
  become: yes
  command: chmod -R go+rx /home/{{ansible_user}}

- name: 'copy tools'
  become: yes
  command: cp {{ item }} /home/{{ansible_user}}/bin
  with_items:
    - /bin/mkdir
    - /bin/echo
    - /bin/rm
    - /bin/tar

- name: 'copy sh'
  become: yes
  command: cp /bin/sh /home/{{ansible_user}}/bin/sh creates=/home/{{ansible_user}}/bin/sh

- name: 'set permissions'
  become: yes
  shell: chmod go+rx /home/{{ ansible_user }}/bin/{{ item }}
  with_items:
    - mkdir
    - echo
    - rm
    - sh
    - tar

- name: 'copy sudo'
  become: yes
  command: cp /usr/bin/sudo /home/{{ansible_user}}/bin/sudo creates=/home/{{ansible_user}}/bin/sudo

- name: 'set suid on sudo'
  become: yes
  file: path=/home/{{ ansible_user }}/bin/sudo mode=4111 owner=root group=root

- name: 'create bashrc'
  template: src=bashrc.j2 dest=/home/{{ansible_user}}/.bashrc mode=0400

- name: 'make sure ansible_user is for non-interactive use'
  copy: src=bash_profile
            dest=/home/{{ ansible_user }}/.bash_profile
{'fraction_non_alphanumeric': 0.15058965830057455, 'fraction_numerical': 0.005442999697611128, 'mean_word_length': 3.2739018087855296, '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': '7222852', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1198, 'n_words': 298}