You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.3 KiB

---
- name: Set up various work related stuff
hosts: localhost
vars:
uid: "{{ lookup('env','USER') }}"
gitops: git+ssh://git@gitops.sunet.se
github: git+ssh://git@github.com/SUNET
platform: git+ssh://git@platform.sunet.se:22022/Drive
commands:
- get_drive_customers
- get_drive_servers
opsrepos:
- sunet-drive-ops
- mail-ops
- platform-ops
puppetrepos:
- puppet-sunet
platformrepos:
- sunetdrive
dockerrepos:
- nextcloud-custom
- dovecot-lda-docker
- postfix-docker
connection: local
become: false
tasks:
- name: Create sunet config folder
ansible.builtin.file:
dest: /home/{{ uid }}/.config/sunet
state: directory
- name: Create sunet folders
ansible.builtin.file:
dest: /home/{{ uid }}/sunet/{{ item }}
state: directory
loop:
- docker
- ops
- puppet
- name: Get gitops ops-repos
ansible.builtin.command:
chdir: /home/{{ uid }}/sunet/ops
cmd: git clone {{ gitops }}/{{ item }}
creates: /home/{{ uid }}/sunet/ops/{{ item }}
loop: "{{ opsrepos }}"
- name: Get github puppet-repos
ansible.builtin.command:
chdir: /home/{{ uid }}/sunet/puppet
cmd: git clone {{ github }}/{{ item }}
creates: /home/{{ uid }}/sunet/puppet/{{ item }}
loop: "{{ puppetrepos }}"
- name: Get github docker-repos
ansible.builtin.command:
chdir: /home/{{ uid }}/sunet/docker
cmd: git clone {{ github }}/{{ item }}
creates: /home/{{ uid }}/sunet/docker/{{ item }}
loop: "{{ dockerrepos }}"
- name: Get platform puppet-repos
ansible.builtin.command:
chdir: /home/{{ uid }}/sunet/puppet
cmd: git clone {{ platform }}/{{ item }}
creates: /home/{{ uid }}/sunet/puppet/{{ item }}
loop: "{{ platformrepos }}"
- name: Install sunet programs
ansible.builtin.file:
src: /home/{{ uid }}/sunet/ops/sunet-drive-ops/{{item}}
dest: /home/{{ uid }}/.local/bin/{{ item }}
state: link
loop: "{{ commands }}"
1 year ago
- name: Add tsocks.conf
ansible.builtin.template:
src: ../templates/tsocks.conf.j2
dest: /etc/tsocks.conf
become: true