ubuntu
change
commit bbe328132bfbf542909701a57f25bec5a1a11ea6
author Alpha Chen <alpha.chen@brilliant.org>
date
parent dd58ffdd
diff --git a/dev/main.yml b/dev/main.yml
index c4bf637..9cad951 100644
--- a/dev/main.yml
+++ b/dev/main.yml
@@ -31,6 +31,9 @@
 - name: Import macos playbook
   import_playbook: macos.yml
 
+- name: Import ubuntu playbook
+  import_playbook: ubuntu.yml
+
 - name: Misc macOS things
   hosts: os_MacOSX
   tasks:
diff --git a/dev/ubuntu.yml b/dev/ubuntu.yml
new file mode 100644
index 0000000..cfb83d9
--- /dev/null
+++ b/dev/ubuntu.yml
@@ -0,0 +1,58 @@
+- name: Set up Ubuntu
+  hosts: os_Ubuntu
+  tasks:
+
+    - name: Add myself to sudoers
+      become: true
+      ansible.builtin.lineinfile:
+        path: /etc/sudoers
+        state: present
+        regexp: '^alpha ALL='
+        line: 'alpha ALL=(ALL) NOPASSWD: ALL'
+        validate: /usr/sbin/visudo -cf %s
+
+    - name: Install git
+      become: true
+      block:
+        - name: Add PPA
+          ansible.builtin.apt_repository:
+            repo: "ppa:git-core/ppa"
+            state: present
+        - name: Install git  # noqa: package-latest
+          ansible.builtin.apt:
+            name: git
+            update_cache: true
+            state: latest
+
+    - name: Install git-lfs
+      become: true
+      block:
+        # https://packagecloud.io/github/git-lfs/install#manual-deb
+        - name: Install dependencies
+          ansible.builtin.apt:
+            name:
+              - debian-archive-keyring
+              - curl
+              - gnupg
+              - apt-transport-https
+            update_cache: true
+        - name: Add the GPG key  # noqa: command-instead-of-module risky-shell-pipe
+          ansible.builtin.shell: >
+            curl -fsSL https://packagecloud.io/github/git-lfs/gpgkey
+            | gpg --dearmor
+            > /etc/apt/keyrings/github_git-lfs-archive-keyring.gpg
+          args:
+            creates: /etc/apt/keyrings/github_git-lfs-archive-keyring.gpg
+        - name: Add apt repo
+          ansible.builtin.copy:
+            dest: /etc/apt/sources.list.d/github_git-lfs.list
+            mode: '0644'
+            content: |
+              deb [signed-by=/etc/apt/keyrings/github_git-lfs-archive-keyring.gpg] https://packagecloud.io/github/git-lfs/ubuntu jammy main
+              deb-src [signed-by=/etc/apt/keyrings/github_git-lfs-archive-keyring.gpg] https://packagecloud.io/github/git-lfs/ubuntu jammy main
+        - name: Install git-lfs
+          ansible.builtin.apt:
+            name: git-lfs
+            update_cache: true
+
+# vim: ft=yaml.ansible