---
- hosts: all
tasks:
- name: Set authorized key taken from file
authorized_key:
user: "{{ansible_user_id}}"
state: present
key: "{{ lookup('file', '/home/mfranz/.ssh/id_rsa.pub') }}"
- name: Copy vector installation script
ansible.builtin.copy:
src: vector-install.sh
dest: /tmp
mode: '0755'
- name: Install vector with easy script
ansible.builtin.shell: /tmp/vector-install.sh
- name: Install packages
ansible.builtin.package:
name:
- mosh
- vector
state: latest
become: true
- name: Copy vector configuration
ansible.builtin.copy:
src: vector.yaml
dest: /etc/vector/vector.yaml
become: true
- name: Restart vector
ansible.builtin.service:
name: vector
state: restarted
become: true
Used ansible-playbook vector-update.yml -i inventory -l pi -u pi -vv --ask-become-pass
or ansible-playbook base.yml -i inventory -l clickhouse-pn50 -u ubuntu -k --step -vvv
Break it up and make it resuable?
- ansible-playbook -i inventory.ini vector-setup.yml
- ansible-galaxy init vector
lots you can do here.
I don't know if your mastodon post was seeking input, if not, ignore!