Skip to content

Instantly share code, notes, and snippets.

@mdfranz
Created January 5, 2025 17:27
Show Gist options
  • Save mdfranz/54278944ac6371312c0f10017490d331 to your computer and use it in GitHub Desktop.
Save mdfranz/54278944ac6371312c0f10017490d331 to your computer and use it in GitHub Desktop.
Janky Ansible Vector install

base.yaml

---
- 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

@mdfranz
Copy link
Author

mdfranz commented Jan 5, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment