working v6

This commit is contained in:
Jens Heinrich 2019-03-20 17:00:42 +01:00
commit 77780ff216
11 changed files with 329 additions and 0 deletions

View file

@ -0,0 +1,32 @@
---
- name: install pkg for bluetooth audio
package:
name: virtual_oss
state: present
become: true
tags:
- install
- name: load the bt security module
lineinfile:
path: "/etc/rc.conf"
regexp: "^{{ item.name }}"
line: "{{ item.name }}={{ item.val }}"
become: true
loop: "{{ sysctl_setting }}"
vars:
sysctl_setting:
- name: "hcsecd_enable"
val: "YES"
- name: load the bt module
lineinfile:
path: "/boot/loader.conf"
regexp: "^{{ item.name }}"
line: "{{ item.name }}={{ item.val }}"
become: true
loop: "{{ sysctl_setting }}"
vars:
sysctl_setting:
- name: "ng_ubt_load"
val: "YES"

View file

@ -0,0 +1,19 @@
---
- name: install chromium
package:
name: chromium
state: present
become: true
tags:
- install
- name: add sared memory
sysctl:
name: "{{ item.name }}"
value: "{{ item.val }}"
become: true
loop: "{{ sysctl_setting }}"
vars:
sysctl_setting:
- name: "kern.ipc.shm_allow_removed"
val: "1"

40
tasks/FreeBSD-ipv6.yml Normal file
View file

@ -0,0 +1,40 @@
---
#https://forums.freebsd.org/threads/is-there-a-working-dhcpv6-client-for-freebsd.60168/
- name: "install the v6 able dhclienzt"
package:
name: dual-dhclient
state: present
become: true
tags:
- installation
# http://www.daemonology.net/blog/2017-01-26-IPv6-on-FreeBSD-EC2.html
- name: "enable dual dhcclient for v6"
lineinfile:
path: "/etc/rc.conf"
regexp: "^{{ item.name }}"
line: "{{ item.name }}=\"{{ item.val }}\""
become: true
loop: "{{ sysctl_setting }}"
tags:
- configuration
vars:
sysctl_setting:
- name: "ifconfig_DEFAULT"
val: " inet6 DHCP"
- name: "ifconfig_DEFAULT"
val: "DHCP accept_rtadv"
- name: "ifconfig_DEFAULT"
val: "DHCP accept_rtadv"
- name: " ipv6_activate_all_interfaces"
val: "YES"
- name: "dhclient_program"
val: "/usr/local/sbin/dual-dhclient"
notify: restart dhclient
# do i ned to disable the old dhclient?

View file

@ -0,0 +1,65 @@
---
- name: "save dhclients dns and dhcp in a file"
lineinfile:
path: "/etc/resolvconf.conf"
regexp: "^{{ item.name }}"
line: "{{ item.name }}={{ item.val }}"
become: true
loop: "{{ sysctl_setting }}"
tags:
- configuration
vars:
sysctl_setting:
- name: "resolv_conf"
val: "/etc/resolv.conf.dhcp"
- name: "enable local_unbound"
lineinfile:
path: "/etc/rc.conf"
regexp: "^{{ item.name }}"
line: "{{ item.name }}={{ item.val }}"
become: true
loop: "{{ sysctl_setting }}"
tags:
- configuration
vars:
sysctl_setting:
- name: "local_unbound_enable"
val: "YES"
- name: manage resolv.conf
template:
dest: /etc/resolv.conf
src: templates/resolv.conf.j2
become: true
tags:
- configuration
- name: "generate access control"
template:
dest: "/etc/unbound/conf.d/access_control.conf"
src: "templates/access_control.j2"
become: true
tags:
- configuration
notify: "restart local_unbound"
- name: "generate overlay for local dns"
template:
dest: "/etc/unbound/conf.d/local_resolver.conf"
src: "templates/local_resolver.j2"
become: true
tags:
- configuration
notify: "restart local_unbound"
- name: "start local_unbound"
service:
name: "local_unbound"
state: started
become: true
tags:
- service
- configuration

56
tasks/FreeBSD-power.yml Normal file
View file

@ -0,0 +1,56 @@
---
- name: disable EIST and throttle
lineinfile:
path: "/boot/loader.conf"
regexp: "^{{ item.name }}"
line: "{{ item.name }}={{ item.val }}"
become: true
loop: "{{ sysctl_setting }}"
vars:
sysctl_setting:
- name: "hint.p4tcc.0.disabled"
val: 1
- name: "hint.acpi_throttle.0.disabled"
val: 1
tags:
- configuration
- name: install powerd++
package:
name: powerdxx
state: present
become: true
tags:
- installation
- name: disable powerd and enable powerd++
lineinfile:
path: "/etc/rc.conf"
regexp: "^{{ item.name }}"
line: "{{ item.name }}=\"{{ item.val }}\""
become: true
loop: "{{ sysctl_setting }}"
vars:
sysctl_setting:
- name: "powerdxx_enable"
val: "YES"
- name: "powerd_enable"
val: "NO"
- name: "powerd_flags"
val: "-a hiadaptive -b adaptive -i 85 -r 60 -p 100"
tags:
- configuration
- name: setup suspend on lid close
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
become: true
loop: "{{ sysctl_setting }}"
vars:
sysctl_setting:
- name: "hw.acpi.lid_switch_state"
value: "S3"
tags:
- configuration

19
tasks/FreeBSD-reader.yml Normal file
View file

@ -0,0 +1,19 @@
---
- name: load modules for the sdcardreader
lineinfile:
path: "/boot/loader.conf"
regexp: "^{{ item.name }}"
line: "{{ item.name }}={{ item.val }}"
become: true
loop: "{{ sysctl_setting }}"
vars:
sysctl_setting:
- name: "sdhcii_load"
val: 1
- name: "mmcsd_load"
val: 1
- name: "mmc_load"
val: 1
tags:
- configuration

View file

@ -0,0 +1,18 @@
---
- name: disable EIST and throttle
lineinfile:
path: "/boot/loader.conf"
regexp: "^{{ item.name }}"
line: "{{ item.name }}={{ item.val }}"
become: true
loop: "{{ sysctl_setting }}"
vars:
sysctl_setting:
- name: "acpi_ibm_load"
val: YES
- name: "hint.acpi_throttle.0.disabled"
val: 1
tags:
- configuration

31
tasks/FreeBSD-sound.yml Normal file
View file

@ -0,0 +1,31 @@
---
- name: install pkg for bluetooth audio
package:
name:
- virtual_oss
- pavucontrol
state: present
become: true
tags:
- install
- name: "set the number of audio channels"
lineinfile:
path: "/etc/sysctl.conf"
regexp: "^{{ item.name }}"
line: "{{ item.name }}={{ item.val }}"
become: true
loop: "{{ sysctl_setting }}"
vars:
sysctl_setting:
- name: "hw.snd.default_unit"
val: "{{ defaultsnddevice }}"
- name: "dev.pcm.0.play.vchans"
val: "{{ audiochannel }}"
- name: "dev.pcm.0.rec.vchans"
val: "{{ audiochannel }}"
- name: "hw.snd.maxautovchans"
val: "{{ audiochannel }}"
- name: "hw.snd.vpc_0db"
val: 15
#https://forums.freebsd.org/threads/low-sound-volume.49620/

8
tasks/keyboard.yml Normal file
View file

@ -0,0 +1,8 @@
---
- name: configure keyboard
template:
src: keyboard-conf.j2
dest: "{{ xorgconfigpath }}/keyboard.conf"
become: true
tags:
- configuration

25
tasks/main.yml Normal file
View file

@ -0,0 +1,25 @@
---
- include: "{{ role_path }}/tasks/vars.yml"
tags:
- vars
- include_tasks: "{{ tweak }}"
tags:
- installation
- configuration
- vars
loop_control:
loop_var: tweak
loop:
- FreeBSD-ipv6.yml
- FreeBSD-localunbound.yml
- FreeBSD-bluetooth.yml
- FreeBSD-sound.yml
- FreeBSD-power.yml
- FreeBSD-chromium.yml
- FreeBSD-reader.yml
- FreeBSD-shortcuts.yml
- keyboard.yml
- "{{ role_path }}/../common/tasks/chip-development.yml"
- "{{ role_path }}/../common/tasks/nmap.yml"

16
tasks/vars.yml Normal file
View file

@ -0,0 +1,16 @@
---
- debug:
msg: "{{ansible_distribution}}-{{ansible_distribution_major_version}}-{{ansible_distribution}}"
verbosity: 0
- name: Load OS specific vars, if available
include_vars: "{{ lookup('first_found', params)}}"
vars:
params:
files:
- '{{ansible_distribution}}-{{ansible_distribution_major_version}}.yml'
- '{{ansible_distribution}}.yml'
- '{{ansible_os_family}}.yml'
- default.yml
paths:
- 'vars'