NewsBlur/ansible/roles/base/tasks/main.yml
2024-03-29 10:31:42 -07:00

84 lines
No EOL
1.7 KiB
YAML

---
- name: Ensure git, zsh, ssl are the latest versions
apt: name={{ sys_packages }} update_cache={{ update_apt_cache }} state=latest
become: yes
tags: packages
# ignore_errors: yes
- name: whoami
debug:
var: ansible_user_id
tags: whoami
- name: Set timezone
become: yes
ansible.builtin.timezone:
name: 'America/New_York'
tags: timezone
- name: Copy zshrc
template:
src: zshrc.txt.j2
dest: /home/nb/.zshrc
tags: zsh
- name: Installing Zsh and git
apt: pkg=zsh,git state=latest
- name: Set zsh as default shell
user: name=nb shell=/usr/bin/zsh
become: yes
- name: Cloning oh-my-zsh
block:
- name: Cloning oh-my-zsh
git:
repo: https://github.com/robbyrussell/oh-my-zsh
dest: /home/nb/.oh-my-zsh
force: yes
rescue:
- name: chown oh-my-zsh
become: yes
file:
path: /home/nb/.oh-my-zsh
owner: nb
group: nb
recurse: yes
- name: Copy toprc
copy: src=toprc.txt dest=~/.toprc
tags: zsh
- name: Copy gitconfig
copy: src=gitconfig.txt dest=~/.gitconfig
- name: Copy ssh config
copy: src=sshconf.txt dest=~/.ssh/config
- name: "Copy motd for {{ motd_role }}"
become: yes
copy: "src=motd.{{ motd_role }}.txt dest=/etc/update-motd.d/52-nb-motd mode=0755"
- name: Ensure repo directory
become: yes
file:
path: /srv/newsblur
state: directory
owner: "{{ ansible_effective_user_id|int }}"
group: "{{ ansible_effective_group_id|int }}"
recurse: yes
- name: "Add inventory_hostname to /etc/hosts"
become: yes
lineinfile:
path: /etc/hosts
line: "127.0.0.1 {{ inventory_hostname }}"
tags: hosts
- name: Set hostname
become: yes
hostname:
name: "{{ inventory_hostname }}"
tags: hosts