feat(netrc): init
This commit is contained in:
parent
04fa692006
commit
9a3dbcfa86
@ -1,3 +1,5 @@
|
|||||||
|
---
|
||||||
|
|
||||||
#
|
#
|
||||||
# Documentation:
|
# Documentation:
|
||||||
# https://yamllint.readthedocs.io/en/stable/
|
# https://yamllint.readthedocs.io/en/stable/
|
||||||
|
@ -25,6 +25,10 @@ unix_users: {}
|
|||||||
# - alice@alice-pc.ed25519.key
|
# - alice@alice-pc.ed25519.key
|
||||||
# home: /home/alice
|
# home: /home/alice
|
||||||
# btrfs: false
|
# btrfs: false
|
||||||
|
# netrc:
|
||||||
|
# - machine_name: hostame.local
|
||||||
|
# login_name: username
|
||||||
|
# password: password
|
||||||
# shell: /bin/bash
|
# shell: /bin/bash
|
||||||
# shell_rc_files:
|
# shell_rc_files:
|
||||||
# - file: "/home/alice/.bashrc.d/docker.bashrc" # absolute or relative path to home dir
|
# - file: "/home/alice/.bashrc.d/docker.bashrc" # absolute or relative path to home dir
|
||||||
|
@ -195,3 +195,12 @@
|
|||||||
- "{{ unix_user.value.shell_rc_files }}"
|
- "{{ unix_user.value.shell_rc_files }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: shell_rc_file
|
loop_var: shell_rc_file
|
||||||
|
|
||||||
|
- name: "Create .netrc file"
|
||||||
|
when: unix_user.value.netrc is defined and unix_user.value.netrc | length > 0
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: netrc.j2
|
||||||
|
dest: "{{ user_user_home }}/.netrc"
|
||||||
|
owner: "{{ unix_user.key }}"
|
||||||
|
group: "{{ unix_user.value.group | default('users') }}"
|
||||||
|
mode: "0600"
|
||||||
|
7
templates/netrc.j2
Normal file
7
templates/netrc.j2
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#jinja2: lstrip_blocks: "True", trim_blocks: "True"
|
||||||
|
#
|
||||||
|
# Ansible Managed
|
||||||
|
#
|
||||||
|
{% for netrc in nix_user.value.netrc %}
|
||||||
|
maschine {{ netrc.maschine }} login {{ netrc.login }} password {{ netrc.password }}
|
||||||
|
{% endfor %}
|
Loading…
x
Reference in New Issue
Block a user