dlundgren / ansible-freebsd-modules Goto Github PK
View Code? Open in Web Editor NEWAnsible Modules for FreeBSD
License: MIT License
Ansible Modules for FreeBSD
License: MIT License
PR #1 indicated that there was a problem with spaces not inserting properly.
Sysrc treats word combinations like addm em0
and addm epair0a
etc. as multiple single words.
E.g. the actions:
- name: Add jail to vnet
sysrc: name="{{ item.name }}" value="{{ item.value }}" state="{{ item.state }}"
loop:
- { name: ifconfig_bridge0, value: "addm em0", state: append }
- { name: ifconfig_bridge0, value: "addm epair0a", state: append }
What I want to achieve is ifconfig_bridge0="addm em0 addm epair0a"
; however both sysrc
-CLI and the sysrc
module create ifconfig_bridge0="addm em0 epair0a"
, which obviously does not have the intended effect (epair0a
is not attached).
Is there any way/workaround to append multi-word values to an existing key?
Some modules can't be unloaded once loaded.
$ kldload -n accf_http
$ kldunload accf_http
kldunload: can't unload file: Operation not supported
$ kldunload -f accf_http
kldunload: can't unload file: Operation not supported
Hi,
The inability to utilise OID style names is an issue when using sysrc to update /boot/loader.conf. Such names are often used, as an example net.pf.source_nodes_hashsize.
Additionally, there appears to be no documentation stating this limitation.
In source, https://github.com/dlundgren/ansible-freebsd-modules/blob/master/library/sysrc at line 237 was the only clue as to why the error message "Name may only contain alpha-numeric and underscore characters" happens.
What is preventing OID style names from being supported? Could the documentation be updated to reflect this limitation until OID style names support is enabled.
Hello. I have a need to edit some values in /etc/login.conf
file and rebuild the database after that.
It would be great to have a module for this task. It may look like
login_conf:
- class: default
insert: ":lang=ru_RU.UTF-8:", ":charset=UTF-8:"
append:
- setenv: "HTTP_PROXY=asdasd"
I'm using your sysrc module in my networking role and it works just great, except in a single spot:
- name: Remove statically configured IPv6 gateway sysrc: dest: /etc/rc.conf name: ipv6_defaultrouter state: absent when: networking_ipv6_gateway is undefined notify: Restart networking
This task keeps reporting 'changed' even though the ipv6_defaultrouter variable is well and truly gone from /etc/rc.conf. I'd rather not revert to using lineinfile for this task but I'm out of ideas. Help?
It looks like sysrc
ans kld
are around for quite a while and mature, so it would be great to see them as a part of the official Ansible
distribution, which lacks proper FreeBSD support.
I tried using the kld
module today to install the aesni
module. It load the module fine, but on subsequent runs it doesn't detect the module as installed and so loads it again, reporting changed on every run.
It looks like using kldstat -m
to detect loaded modules isn't always accurate, as the module name doesn't match modname. In this case aesni.ko
loads a modname called nexus/aesni
.
$ kldstat | grep aesni
4 1 0xffffffff8248d000 bd50 aesni.ko
$ kldstat -m aesni
kldstat: can't find module aesni: No such file or directory
$ kldstat -v | grep -C 1 aesni
1 opensolaris
4 1 0xffffffff8248d000 bd50 aesni.ko (/boot/kernel/aesni.ko)
Contains modules:
Id Name
6 nexus/aesni
5 1 0xffffffff82499000 84b0 cryptodev.ko (/boot/kernel/cryptodev.ko)
OID-like variables are the variables like vm.kmem_size
or vfs.zfs.vdev.cache.size
, which are used in /boot/loader.conf
or /etc/sysctl.conf
for example.
Editing them with sysrc
used to work in the past, but since mid-summer 2018 a patch from PR 187461 was applied and things broke.
Now, on an attempt to use such a variable an error is displayed:
# sysrc -f /boot/loader.conf vm.kmem_size
sysrc: vm.kmem_size: name contains characters not allowed in shell
and an exit code of 1 is returned, which is not detected by the sysrc
module:
TASK [zfs : ensure /boot/loader.conf has correct the ZFS settings] *********************************************************************************************************************************************************************************
ok: [10.168.170.3] => (item={u'name': u'zfs_load', u'value': u'YES'}) => {"changed": false, "delim": " ", "dest": "/boot/loader.conf", "gid": 0, "group": "wheel", "item": {"name": "zfs_load", "value": "YES"}, "mode": "0644", "name": "zfs_load", "owner": "root", "size": 87, "state": "file", "uid": 0, "value": "YES"}
ok: [10.168.170.3] => (item={u'name': u'vm.kmem_size', u'value': u'330M'}) => {"changed": false, "delim": " ", "dest": "/boot/loader.conf", "gid": 0, "group": "wheel", "item": {"name": "vm.kmem_size", "value": "330M"}, "mode": "0644", "name": "vm.kmem_size", "owner": "root", "size": 87, "state": "file", "uid": 0, "value": "330M"}
ok: [10.168.170.3] => (item={u'name': u'vm.kmem_size_max', u'value': u'330M'}) => {"changed": false, "delim": " ", "dest": "/boot/loader.conf", "gid": 0, "group": "wheel", "item": {"name": "vm.kmem_size_max", "value": "330M"}, "mode": "0644", "name": "vm.kmem_size_max", "owner": "root", "size": 87, "state": "file", "uid": 0, "value": "330M"}
ok: [10.168.170.3] => (item={u'name': u'vm.zfs.arc_max', u'value': u'40M'}) => {"changed": false, "delim": " ", "dest": "/boot/loader.conf", "gid": 0, "group": "wheel", "item": {"name": "vm.zfs.arc_max", "value": "40M"}, "mode": "0644", "name": "vm.zfs.arc_max", "owner": "root", "size": 87, "state": "file", "uid": 0, "value": "40M"}
ok: [10.168.170.3] => (item={u'name': u'vfs.zfs.vdev.cache.size', u'value': u'5M'}) => {"changed": false, "delim": " ", "dest": "/boot/loader.conf", "gid": 0, "group": "wheel", "item": {"name": "vfs.zfs.vdev.cache.size", "value": "5M"}, "mode": "0644", "name": "vfs.zfs.vdev.cache.size", "owner": "root", "size": 87, "state": "file", "uid": 0, "value": "5M"}
PLAY RECAP *****************************************************************************************************************************************************************************************************************************************
10.168.170.3 : ok=4 changed=0 unreachable=0 failed=0
If you change from "some value with spaces and more" to "some value with spaces" the change is not being properly detected and send back to ansible
Hi.
I'm writing a role that needs to write custom values to loader.conf.
cpu_microcode_load="YES"
cpu_microcode_name="/boot/firmware/intel-ucode.bin"
As I see in the documentation, I can't set the second line with kld. Right?
Would it be possible to add this? I don't know python so I can't help here.
Best regards
Chris
Converting this to a collection would make it easier to use until the modules are pulled in to a community collection.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.