Add ndproxy to support neighbor discovery of VMs from the public internet.
This commit is contained in:
parent
613204d9fa
commit
9bc3aed323
@ -104,6 +104,7 @@
|
||||
- wireguard
|
||||
- emacs
|
||||
- mrmanager
|
||||
- ndproxy
|
||||
|
||||
- hosts: admin_git:public_dns
|
||||
vars:
|
||||
|
||||
@ -70,6 +70,7 @@ pass quick on $allow
|
||||
# doas route add -host 74.80.180.139 -interface jail_nat
|
||||
# doas route add -net 10.129.0.0/16 -interface jail_nat
|
||||
# ? doas route -6 add -net '2620:11f:7001:7:ffff:ffff:0ad7:0100/120' -interface jail_nat
|
||||
# ? doas ifconfig jail_nat inet6 2620:11f:7001:7:ffff:ffff:0ad7:0101/120
|
||||
# doas sysctl net.link.ether.inet.proxyall=1
|
||||
# Plus this in pf.conf:
|
||||
# pass quick from any to 74.80.180.139
|
||||
|
||||
1
ansible/roles/ndproxy/defaults/main.yaml
Normal file
1
ansible/roles/ndproxy/defaults/main.yaml
Normal file
@ -0,0 +1 @@
|
||||
# foo: []
|
||||
0
ansible/roles/ndproxy/files/foo
Normal file
0
ansible/roles/ndproxy/files/foo
Normal file
14
ansible/roles/ndproxy/handlers/main.yaml
Normal file
14
ansible/roles/ndproxy/handlers/main.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
# - name: restart foo freebsd
|
||||
# when: 'os_flavor == "freebsd"'
|
||||
# listen: restart foo
|
||||
# service:
|
||||
# name: foo
|
||||
# state: restarted
|
||||
|
||||
# - name: restart ssh linux
|
||||
# when: 'os_flavor == "linux"'
|
||||
# listen: restart foo
|
||||
# systemd:
|
||||
# state: restarted
|
||||
# name: foo
|
||||
# daemon_reload: yes
|
||||
2
ansible/roles/ndproxy/meta/main.yaml
Normal file
2
ansible/roles/ndproxy/meta/main.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
# dependencies:
|
||||
# - users
|
||||
55
ansible/roles/ndproxy/tasks/common.yaml
Normal file
55
ansible/roles/ndproxy/tasks/common.yaml
Normal file
@ -0,0 +1,55 @@
|
||||
# - name: Create directories
|
||||
# file:
|
||||
# name: "{{ item }}"
|
||||
# state: directory
|
||||
# mode: 0755
|
||||
# owner: root
|
||||
# group: wheel
|
||||
# loop:
|
||||
# - /foo/bar
|
||||
|
||||
# - name: Install scripts
|
||||
# copy:
|
||||
# src: "files/{{ item.src }}"
|
||||
# dest: "{{ item.dest }}"
|
||||
# mode: 0755
|
||||
# owner: root
|
||||
# group: wheel
|
||||
# loop:
|
||||
# - src: foo.bash
|
||||
# dest: /usr/local/bin/foo
|
||||
|
||||
# - name: Install Configuration
|
||||
# copy:
|
||||
# src: "files/{{ item.src }}"
|
||||
# dest: "{{ item.dest }}"
|
||||
# mode: 0600
|
||||
# owner: root
|
||||
# group: wheel
|
||||
# loop:
|
||||
# - src: foo.conf
|
||||
# dest: /usr/local/etc/foo.conf
|
||||
|
||||
# - name: Clone Source
|
||||
# git:
|
||||
# repo: "https://foo.bar/baz.git"
|
||||
# dest: /foo/bar
|
||||
# version: "v1.0.2"
|
||||
# force: true
|
||||
# diff: false
|
||||
|
||||
- import_tasks: tasks/freebsd.yaml
|
||||
when: 'os_flavor == "freebsd"'
|
||||
|
||||
- import_tasks: tasks/linux.yaml
|
||||
when: 'os_flavor == "linux"'
|
||||
|
||||
- include_tasks:
|
||||
file: tasks/peruser.yaml
|
||||
apply:
|
||||
become: yes
|
||||
become_user: "{{ initialize_user }}"
|
||||
when: users is defined
|
||||
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
|
||||
loop_control:
|
||||
loop_var: initialize_user
|
||||
15
ansible/roles/ndproxy/tasks/freebsd.yaml
Normal file
15
ansible/roles/ndproxy/tasks/freebsd.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
- name: Install packages
|
||||
package:
|
||||
name:
|
||||
- ndproxy
|
||||
state: present
|
||||
|
||||
- name: Install service configuration
|
||||
copy:
|
||||
src: "files/{{ item }}_rc.conf"
|
||||
dest: "/etc/rc.conf.d/{{ item }}"
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: wheel
|
||||
loop:
|
||||
- ndproxy
|
||||
29
ansible/roles/ndproxy/tasks/linux.yaml
Normal file
29
ansible/roles/ndproxy/tasks/linux.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
# - name: Build aur packages
|
||||
# register: buildaur
|
||||
# become_user: "{{ build_user.name }}"
|
||||
# command: "aurutils-sync --no-view {{ item }}"
|
||||
# args:
|
||||
# creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*"
|
||||
# loop:
|
||||
# - foo
|
||||
|
||||
# - name: Update cache
|
||||
# when: buildaur.changed
|
||||
# pacman:
|
||||
# name: []
|
||||
# state: present
|
||||
# update_cache: true
|
||||
|
||||
# - name: Install packages
|
||||
# package:
|
||||
# name:
|
||||
# - foo
|
||||
# state: present
|
||||
|
||||
# - name: Enable services
|
||||
# systemd:
|
||||
# enabled: yes
|
||||
# name: "{{ item }}"
|
||||
# daemon_reload: yes
|
||||
# loop:
|
||||
# - foo.service
|
||||
2
ansible/roles/ndproxy/tasks/main.yaml
Normal file
2
ansible/roles/ndproxy/tasks/main.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
- import_tasks: tasks/common.yaml
|
||||
# when: foo is defined
|
||||
29
ansible/roles/ndproxy/tasks/peruser.yaml
Normal file
29
ansible/roles/ndproxy/tasks/peruser.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
- include_role:
|
||||
name: per_user
|
||||
|
||||
# - name: Create directories
|
||||
# file:
|
||||
# name: "{{ account_homedir.stdout }}/{{ item }}"
|
||||
# state: directory
|
||||
# mode: 0700
|
||||
# owner: "{{ account_name.stdout }}"
|
||||
# group: "{{ group_name.stdout }}"
|
||||
# loop:
|
||||
# - ".config/foo"
|
||||
|
||||
# - name: Copy files
|
||||
# copy:
|
||||
# src: "files/{{ item.src }}"
|
||||
# dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
|
||||
# mode: 0600
|
||||
# owner: "{{ account_name.stdout }}"
|
||||
# group: "{{ group_name.stdout }}"
|
||||
# loop:
|
||||
# - src: foo.conf
|
||||
# dest: .config/foo/foo.conf
|
||||
|
||||
- import_tasks: tasks/peruser_freebsd.yaml
|
||||
when: 'os_flavor == "freebsd"'
|
||||
|
||||
- import_tasks: tasks/peruser_linux.yaml
|
||||
when: 'os_flavor == "linux"'
|
||||
0
ansible/roles/ndproxy/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/ndproxy/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/ndproxy/tasks/peruser_linux.yaml
Normal file
0
ansible/roles/ndproxy/tasks/peruser_linux.yaml
Normal file
0
ansible/roles/ndproxy/templates/foo.yaml.j2
Normal file
0
ansible/roles/ndproxy/templates/foo.yaml.j2
Normal file
Loading…
x
Reference in New Issue
Block a user