diff --git a/playbook.yml b/playbook.yml index 8588ebf..4df5b25 100644 --- a/playbook.yml +++ b/playbook.yml @@ -31,6 +31,7 @@ - { role: sound, tags: ['sound'] } - { role: archive, tags: ['archive'] } - { role: filesystems, tags: ['filesystems'] } + - { role: pim, tags: ['pim'] } vars_prompt: - name: user_password prompt: "Enter desired user password" diff --git a/roles/mail/tasks/contacts.yml b/roles/mail/tasks/contacts.yml index 09e1f33..342b93a 100644 --- a/roles/mail/tasks/contacts.yml +++ b/roles/mail/tasks/contacts.yml @@ -16,57 +16,3 @@ - contacts become: yes become_user: "{{ user.name }}" - -- name: Download vdirsyncer - command: cower -dq vdirsyncer - chdir=/home/{{ user.name }}/{{ aur.dir }} - creates=/home/{{ user.name }}/{{ aur.dir }}/vdirsyncer - tags: - - aur - - contacts - become: yes - become_user: "{{ user.name }}" - -- name: Build and install vdirsyncer - command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/vdirsyncer" - tags: - - aur - - contacts - become: yes - become_user: "{{ user.name }}" - -- name: Download python2-vobject - command: cower -dq python2-vobject - chdir=/home/{{ user.name }}/{{ aur.dir }} - creates=/home/{{ user.name }}/{{ aur.dir }}/python2-vobject - tags: - - aur - - contacts - become: yes - become_user: "{{ user.name }}" - -- name: Build and install python2-vobject - command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/python2-vobject" - tags: - - aur - - contacts - become: yes - become_user: "{{ user.name }}" - -- name: Download khard-git - command: cower -dq khard-git - chdir=/home/{{ user.name }}/{{ aur.dir }} - creates=/home/{{ user.name }}/{{ aur.dir }}/khard-git - tags: - - aur - - contacts - become: yes - become_user: "{{ user.name }}" - -- name: Build and install khard-git - command: "{{ aur.makepkg }} chdir=/home/{{ user.name }}/{{ aur.dir }}/khard-git" - tags: - - aur - - contacts - become: yes - become_user: "{{ user.name }}" diff --git a/roles/pim/tasks/main.yml b/roles/pim/tasks/main.yml new file mode 100644 index 0000000..60e7f55 --- /dev/null +++ b/roles/pim/tasks/main.yml @@ -0,0 +1,43 @@ +--- +- name: Install vdirsyncer into virtual environment + pip: name=vdirsyncer + virtualenv=/home/{{ user.name }}/.virtualenvs/pim + virtualenv_command=virtualenv-2.7 + become: yes + become_user: "{{ user.name }}" + +- name: Install khard into virtual environment + pip: name=khard + virtualenv=/home/{{ user.name }}/.virtualenvs/pim + virtualenv_command=virtualenv-2.7 + become: yes + become_user: "{{ user.name }}" + +- name: Install khal into virtual environment + pip: name=khal + virtualenv=/home/{{ user.name }}/.virtualenvs/pim + virtualenv_command=virtualenv-2.7 + become: yes + become_user: "{{ user.name }}" + +- name: Check if user bin exists + stat: path=/home/{{ user.name }}/bin + register: check_bin + +- name: Link vdirsyncer to user bin + file: src=/home/{{ user.name }}/.virtualenvs/pim/bin/vdirsyncer + dest=/home/{{ user.name }}/bin/vdirsyncer + state=link + when: check_bin.stat.exists + +- name: Link khard to user bin + file: src=/home/{{ user.name }}/.virtualenvs/pim/bin/khard + dest=/home/{{ user.name }}/bin/khard + state=link + when: check_bin.stat.exists + +- name: Link khal to user bin + file: src=/home/{{ user.name }}/.virtualenvs/pim/bin/khal + dest=/home/{{ user.name }}/bin/khal + state=link + when: check_bin.stat.exists