Commit graph

25 commits

Author SHA1 Message Date
Piotr Śliwka
e8c82f9e57 Implement Ansible:check_mode()
Not very elegant way, but seems to work.
2019-07-27 11:57:17 +02:00
Piotr Śliwka
97f3196430 Update parameter name to work with Ansible 2.6 2019-07-27 11:57:17 +02:00
Simon Schuster
c10cf880a8 Bugfix: Ignore "checksum" parameter in copy module
When copying, recent versions of ansible set the "checksum" field of the
json-payload for validation of the file after copy. As of now, we simply
ignore the parameter.
2018-04-01 23:44:29 +02:00
Nick Cabatoff
31e703920d Report on what changed after a set/match/values. 2017-10-08 23:45:43 +02:00
Nick Cabatoff
22bcbb825a Add new options 'match' and 'values'. Add new op 'get'.
New set mode: set path=config match={} values={}

  Find uci sections based on path and match, modify their
  properties according to values.

  # Modify settings for pre-existing wireless interface with device radio0.
  - name: configure wireless
    uci:
      path: wireless
      match:
        device: radio0
        type: wifi-iface
      values:
        ssid: myssid
        encryption: psk2
        key: "secret passphrase"

New op: get path=config[.section] [type=t] [match=m]

  Used with register var x, outputs to x.result['values']
  (x.result.values won't work.)  This can be used for conditions
  in subsequent tasks.

  # See if there already exists a forwarding config with dest=myvpn and src=lan
  - name: Get myvpn zone forwarding
    uci: op=get path=firewall type=forwarding match="dest=myvpn src=lan"
    register: myvpnfw
  # Create the section if it doesn't exist
  - name: Add myvpn zone forwarding
    uci: autocommit=false path=firewall type=forwarding
    when: not myvpnfw.result['values']
  # Populate the section if it didn't exist
  - name: Setup myvpn zone forwarding
    uci: autocommit=false path=firewall.@forwarding[-1].{{ item.key }} value={{ item.value}}
    with_dict:
      dest: myvpn
      src: lan
    when: not myvpnfw.result['values']
2017-10-08 23:45:43 +02:00
Nick Cabatoff
f5f9d7ff38 Fix bogus perl syntax. 2017-10-02 09:08:21 +02:00
Simon Schuster
b48d89d3d8 Add the section-type alias in the uci module 2016-09-18 13:20:45 +02:00
Simon Schuster
f2d6b3a456 Uci: handling for list types 2016-09-08 10:57:15 +02:00
Simon Schuster
6bc7fc33d8 fix uci facts collection 2016-09-08 10:56:44 +02:00
Simon Schuster
cdc25b0300 Fix option hiding bug 2016-09-08 10:54:35 +02:00
Simon Schuster
2b1a9896b2 Make fatpack executable 2016-09-06 14:48:45 +02:00
Simon Schuster
874209c804 Allow packages in fatpack-whitelists 2016-09-06 14:46:09 +02:00
Simon Schuster
1bec9a01e3 Added copy, file, lineinfile 2016-09-06 11:58:46 +02:00
Simon Schuster
41b7e5787c Imported sha1.lua from upstream 2016-09-05 15:01:12 +02:00
Simon Schuster
5e0d4b0e82 imported BinDecHex from upstream 2016-09-03 16:04:28 +02:00
Simon Schuster
f2be7d2b04 Added a uci module 2016-09-02 21:57:24 +02:00
Simon Schuster
f279c08267 Added a ubus module to lua 2016-09-02 21:57:03 +02:00
Simon Schuster
82685dab40 Add ubus_{call,connect} to ansible.lua 2016-09-02 21:56:40 +02:00
Simon Schuster
6fc8d3cfeb Export and namespace Ansible.contains 2016-09-02 21:56:19 +02:00
Simon Schuster
5023d9c4da Added opkg module 2016-08-30 16:16:28 +02:00
Simon Schuster
c8e69b9b7a ansible: ignore _ansible parameters and don't emit trailing newlines 2016-08-30 16:16:11 +02:00
Simon Schuster
839c072ae2 Added Ansible module 2016-08-30 14:14:14 +02:00
Simon Schuster
b31a3a0e1c fatpack.pl: Add the ability to whitelist modules 2016-08-30 13:55:28 +02:00
Simon Schuster
b714731484 Imported dkjson v2.5 from upstream 2016-08-28 21:06:06 +02:00
Simon Schuster
3876867418 Add lua fatpacker 2016-08-28 21:05:35 +02:00