mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Optimized performance by moving multiple similar when includes to own tasks file
This commit is contained in:
42
roles/pkgmgr/tasks/01_core.yml
Normal file
42
roles/pkgmgr/tasks/01_core.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
- name: Ensure GitHub host key is in known_hosts
|
||||
known_hosts:
|
||||
path: "~/.ssh/known_hosts"
|
||||
name: github.com
|
||||
key: "{{ lookup('pipe', 'ssh-keyscan -t ed25519 github.com | grep -v \"^#\"') }}"
|
||||
become: true
|
||||
|
||||
- name: Create installation directory for Kevin's Package Manager
|
||||
file:
|
||||
path: "{{ pkgmgr_install_path }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
become: true
|
||||
|
||||
- name: Clone Kevin's Package Manager repository
|
||||
git:
|
||||
repo: "{{ pkgmgr_repo_url }}"
|
||||
dest: "{{ pkgmgr_install_path }}"
|
||||
version: "HEAD"
|
||||
force: yes
|
||||
become: true
|
||||
|
||||
- name: Ensure main.py is executable
|
||||
file:
|
||||
path: "{{ pkgmgr_install_path }}/main.py"
|
||||
mode: '0755'
|
||||
become: true
|
||||
|
||||
- name: create config.yaml
|
||||
template:
|
||||
src: config.yaml.j2
|
||||
dest: "{{pkgmgr_config_path}}"
|
||||
become: true
|
||||
|
||||
- name: Run the Package Manager install command to create an alias for Kevins package manager
|
||||
shell: |
|
||||
source ~/.venvs/pkgmgr/bin/activate
|
||||
make setup
|
||||
args:
|
||||
chdir: "{{ pkgmgr_install_path }}"
|
||||
executable: /bin/bash
|
||||
become: true
|
Reference in New Issue
Block a user