Files @ 74b1cab547fc
Branch filter:

Location: majic-ansible-roles/roles/bootstrap/tasks/main.yml

branko
MAR-122: Fixed handling of complex package versions for pip with Ansible 2.x:

- Use list for installing specific version of pip in the "pipreqcheck" virtual
environment in common role.
- Removed superficious (and incorrect) definition for application admin username
in wsgi_website role.
- Updated test playbook for wsgi_website role to test the fix.
- Switched to passing-in package list for installing packages in virtual
environment instead of using "with_items" in wsgi_website role.
---

- name: Install sudo
  apt:
    name: sudo
    state: installed

- name: Set-up the Ansible group
  group:
    name: ansible
    system: yes

- name: Set-up the Ansible user
  user:
    name: ansible
    system: yes
    group: ansible
    shell: /bin/bash

- name: Set-up authorized key for the Ansible user
  authorized_key:
    user: ansible
    key: "{{ ansible_key }}"

- name: Set-up password-less sudo for the ansible user
  copy:
    src: "ansible_sudo"
    dest: "/etc/sudoers.d/ansible"
    mode: 0640
    owner: root
    group: root

- name: Revoke rights for Ansible user to log-in as root to server via ssh
  authorized_key:
    user: root
    key: "{{ ansible_key }}"
    state: absent

- name: Explicitly run all handlers
  include: ../handlers/main.yml
  when: "handlers | default(False) | bool() : :  True"
  tags:
    - handlers