[test last]
This commit is contained in:
40
backup.yml
40
backup.yml
@@ -41,35 +41,14 @@
|
|||||||
|
|
||||||
- name: Install Bitwarden CLI
|
- name: Install Bitwarden CLI
|
||||||
block:
|
block:
|
||||||
- name: Download bw
|
- name: bitwarden token session
|
||||||
get_url:
|
ansible.builtin.command:
|
||||||
url: https://github.com/bitwarden/clients/releases/download/cli-v2024.1.0/bw-linux-2024.1.0.zip
|
cmd: "{{ item }}"
|
||||||
dest: /tmp/bw.zip
|
loop:
|
||||||
delegate_to: localhost
|
- sudo apk add --no-cache nodejs npm
|
||||||
|
- sudo npm install -g @bitwarden/cli
|
||||||
- name: Unzip bw
|
|
||||||
unarchive:
|
|
||||||
src: /tmp/bw.zip
|
|
||||||
dest: /tmp/
|
|
||||||
remote_src: yes
|
|
||||||
delegate_to: localhost
|
|
||||||
|
|
||||||
- name: Install bw
|
|
||||||
copy:
|
|
||||||
src: /tmp/bw
|
|
||||||
dest: /usr/local/bin/bw
|
|
||||||
mode: '0755'
|
|
||||||
remote_src: yes
|
|
||||||
delegate_to: localhost
|
|
||||||
|
|
||||||
- ansible.builtin.pause:
|
|
||||||
seconds: 30
|
|
||||||
|
|
||||||
when: bw_check.rc != 0
|
when: bw_check.rc != 0
|
||||||
|
|
||||||
|
|
||||||
- ansible.builtin.pause:
|
|
||||||
seconds: 500
|
|
||||||
|
|
||||||
- name: bitwarden token session
|
- name: bitwarden token session
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
@@ -84,11 +63,6 @@
|
|||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
register: bw_session_result
|
register: bw_session_result
|
||||||
|
|
||||||
|
|
||||||
- debug:
|
|
||||||
msg: "{{ bw_session_result }}"
|
|
||||||
|
|
||||||
#
|
|
||||||
- name: Utiliser le lookup
|
- name: Utiliser le lookup
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ lookup('community.general.bitwarden', 'Token full access gitea', field='password') }}"
|
msg: "{{ lookup('community.general.bitwarden', 'Token full access gitea', field='password') }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user