From 1fd36409b134ecfe31a93151eafbbd2f623d104c Mon Sep 17 00:00:00 2001 From: tobi Date: Wed, 30 Mar 2022 22:37:28 +0200 Subject: [PATCH] update --- arch_basics.yaml | 198 ++++++++++++++++++++++++----------------------- 1 file changed, 103 insertions(+), 95 deletions(-) diff --git a/arch_basics.yaml b/arch_basics.yaml index c6d7f5f..6647431 100644 --- a/arch_basics.yaml +++ b/arch_basics.yaml @@ -1,111 +1,119 @@ +# --- +# - hosts: localhost +# vars: +# - username: sammy +# - home: /home/sammy +# tasks: +# - name: print variables +# debug: +# msg: "Username: {{ username }}, Home dir: {{ home }}" + --- -# - name: Basic Arch Linux installation -hosts: - localhost: - vars: - - hostname: 'test-vm' - tasks: - - name: Update and Upgrade all exisiting packages - community.general.pacman: - update_cache: yes - upgrade: yes +- hosts: localhost + vars: + - hostname: 'test-vm' + tasks: + - name: Update and Upgrade all exisiting packages + community.general.pacman: + update_cache: yes + upgrade: yes - - name: Install basic packages - community.general.pacman: - name: sudo,zsh,htop,autoconf,automake,binutils,bison,file,findutils,flex,gawk,gcc,gettext,grep,groff,gzip,libtool,m4,make,patch,pkgconf,sed,texinfo,which,base-devel - state: present + - name: Install basic packages + community.general.pacman: + name: sudo,zsh,htop,autoconf,automake,binutils,bison,file,findutils,flex,gawk,gcc,gettext,grep,groff,gzip,libtool,m4,make,patch,pkgconf,sed,texinfo,which,base-devel + state: present - - name: Make sure we have a 'wheel' group - group: - name: wheel - state: present + - name: Make sure we have a 'wheel' group + group: + name: wheel + state: present - - name: Allow 'wheel' to be sudo - lineinfile: - dest: /etc/sudoers - state: present - regexp: '^%wheel' - line: '%wheel ALL=(ALL) ALL' + - name: Allow 'wheel' to be sudo + lineinfile: + dest: /etc/sudoers + state: present + regexp: '^%wheel' + line: '%wheel ALL=(ALL) ALL' - - name: Add the user tobi - ansible.builtin.user: - name: tobi - password: $6$9OnvBMN6Sxc.muW1$afASAJdoPZL/WxTp6.lh/SurRRiClaru2Pl19fEo6j1aDEQw99kdkfls6.DB8OBacBDnT3bpsLYD3JqrvXlE9/ - comment: Tobias Maier - groups: wheel - shell: /bin/zsh + - name: Add the user tobi + ansible.builtin.user: + name: tobi + password: $6$9OnvBMN6Sxc.muW1$afASAJdoPZL/WxTp6.lh/SurRRiClaru2Pl19fEo6j1aDEQw99kdkfls6.DB8OBacBDnT3bpsLYD3JqrvXlE9/ + comment: Tobias Maier + groups: wheel + shell: /bin/zsh - - name: Add name to git config - community.general.git_config: - name: user.name - scope: system - value: Tobias Maier + - name: Add name to git config + community.general.git_config: + name: user.name + scope: system + value: Tobias Maier - - name: Add email to git config - community.general.git_config: - name: user.email - scope: system - value: admin@maiertobi.de + - name: Add email to git config + community.general.git_config: + name: user.email + scope: system + value: admin@maiertobi.de - - name: Create the `aur_builder` user - ansible.builtin.user: - name: aur_builder - create_home: yes - #group: wheel + - name: Create the `aur_builder` user + ansible.builtin.user: + name: aur_builder + create_home: yes + #group: wheel - - name: Allow the `aur_builder` user to run `sudo pacman` without a password - ansible.builtin.lineinfile: - path: /etc/sudoers.d/11-install-aur_builder - line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman' - create: yes - validate: 'visudo -cf %s' + - name: Allow the `aur_builder` user to run `sudo pacman` without a password + ansible.builtin.lineinfile: + path: /etc/sudoers.d/11-install-aur_builder + line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman' + create: yes + validate: 'visudo -cf %s' - - name: Install paru using makepkg if it isn't installed already - kewlfft.aur.aur: - name: paru - use: makepkg - state: present - become: yes - become_method: su - become_user: aur_builder + - name: Install paru using makepkg if it isn't installed already + kewlfft.aur.aur: + name: paru + use: makepkg + state: present + become: yes + become_method: su + become_user: aur_builder - - name: Install packages from AUR - kewlfft.aur.aur: - use: paru - name: oh-my-zsh-git,zsh-theme-powerlevel10k-git,zsh-autosuggestions,zsh-syntax-highlighting,openssh - state: present - become: yes - become_user: aur_builder + - name: Install packages from AUR + kewlfft.aur.aur: + use: paru + name: oh-my-zsh-git,zsh-theme-powerlevel10k-git,zsh-autosuggestions,zsh-syntax-highlighting,openssh + state: present + become: yes + become_user: aur_builder - - name: Clone dotfiles - ansible.builtin.git: - repo: https://gitea.maiertobi.de/tobimai/dotfiles.git - dest: /tmp/dotfiles + - name: Clone dotfiles + ansible.builtin.git: + repo: https://gitea.maiertobi.de/tobimai/dotfiles.git + dest: /tmp/dotfiles - - name: Copy zshrc to home dir - ansible.builtin.copy: - src: //tmp/dotfiles/.zshrc - dest: /home/tobi/.zshrc - owner: tobi - group: tobi - mode: '0644' + - name: Copy zshrc to home dir + ansible.builtin.copy: + src: //tmp/dotfiles/.zshrc + dest: /home/tobi/.zshrc + owner: tobi + group: tobi + mode: '0644' - - name: Copy p10k to home dir - ansible.builtin.copy: - src: //tmp/dotfiles/.p10k.zsh - dest: /home/tobi/.p10k.zsh - owner: tobi - group: tobi - mode: '0644' + - name: Copy p10k to home dir + ansible.builtin.copy: + src: //tmp/dotfiles/.p10k.zsh + dest: /home/tobi/.p10k.zsh + owner: tobi + group: tobi + mode: '0644' - - name: Set a hostname - hostname: - name: "{{ hostname }}" + - name: Set a hostname + hostname: + name: "{{ hostname }}" - # - name: Add ssh-rsa to ssh config as this seems to be disabled by default - # blockinfile: - # path: /etc/ssh/ssh_config - # block: | - # Host * - # HostKeyAlgorithms ssh-rsa - # PubkeyAcceptedKeyTypes ssh-rsa \ No newline at end of file + # - name: Add ssh-rsa to ssh config as this seems to be disabled by default + # blockinfile: + # path: /etc/ssh/ssh_config + # block: | + # Host * + # HostKeyAlgorithms ssh-rsa + # PubkeyAcceptedKeyTypes ssh-rsa \ No newline at end of file