Commit graph

65 commits

Author SHA1 Message Date
aa19e1cfd3 fixup! Allow for options containing commas 2021-02-16 09:50:36 +01:00
a5f1bb0821 Disable usetty
This ensures that big outputstreams are transmitted completly
2019-12-01 01:07:42 +01:00
68504e1035 Do not write to flash for ad-hoc commands 2019-12-01 01:07:08 +01:00
50764b07fc add md5 as checksum algorithm for stat module 2019-12-01 01:05:21 +01:00
cdc207061b Allow for options containing commas
* instead of the boolean forcelist use force=option or force=list
2019-12-01 01:03:29 +01:00
88fcad3e29 Fix some typos 2019-12-01 01:02:21 +01:00
Piotr Śliwka
70b62b760f Add cache_valid_time param to opkg module
Modelled after similar param in `apt`.
2019-07-27 11:57:17 +02:00
Piotr Śliwka
4cf2ece184 Update openwrt-in-vagrant 2019-07-27 11:57:17 +02:00
Piotr Śliwka
adaf71f307 Switch to upstream openwrt-in-vagrant 2019-07-27 11:57:17 +02:00
Piotr Śliwka
7aa64ff5ab Implement check mode in opkg module 2019-07-27 11:57:17 +02:00
Piotr Śliwka
32ec3f0f5f Minor slurp improvement 2019-07-27 11:57:17 +02:00
Piotr Śliwka
b26403a90b Implement diff mode in lineinfile 2019-07-27 11:57:17 +02:00
Piotr Śliwka
29229d0641 Use json args inlining instead of WANT_JSON
This improves performance by limiting amount of `scp` calls needed to
run each task.
2019-07-27 11:57:17 +02:00
Piotr Śliwka
ef6f95221a Leave note about bug in lineinfile 2019-07-27 11:57:17 +02:00
Piotr Śliwka
31ee0422eb Improve slurp module
Deduplicate code, improve error handling.
2019-07-27 11:57:17 +02:00
Piotr Śliwka
391a084784 Implement basic slurp module
Also fixes problem with missing diff when running `copy`.
2019-07-27 11:57:17 +02:00
Piotr Śliwka
6a345bb847 Do not enforce setting msg in exit_json
In plain Ansible, `msg` is mandatory only for `fail_json`.
2019-07-27 11:57:17 +02:00
Piotr Śliwka
6e34f15045 Make fatpack output more deterministic
This reduces the diff between compiled modules in subsequent commits.
2019-07-27 11:57:17 +02:00
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
Piotr Śliwka
2a3aec90d6 Reduce flash wear on target device
By default, ansible stores its temporary files in `$HOME/.ansible/tmp`.
This causes many files to be created on target device's internal flash
memory on every ansible run (even if run with --check or if there are no
changes), wearing it unnecessarily.

This commit changes default remote_tmp location to a directory mounted
in RAM as tmpfs, so that the flash memory is not touched unless there is
actual change in device's configuration.
2019-07-27 11:57:17 +02:00
Piotr Śliwka
09ef98d723 Add minimal role metadata
An empty dependency list is needed to suppres ansible-galaxy warnings.
2018-08-31 21:22:09 +02:00
Simon Schuster
3ead6b2e3e README: Fix indentation for playbook-samples 2018-04-02 01:02:08 +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
b51a77f3ae Another typo 2016-10-03 14:51:29 +02:00
Simon Schuster
2a2c7df18d Typo fixed
thanks yushyin
2016-10-03 00:32:09 +02:00
Simon Schuster
7f6d28fef7 Fix typo 2016-09-18 14:06:09 +02:00
noctux
266f28e6f1 Fix markdown in README once more :/ 2016-09-18 13:50:34 +02:00
noctux
a8a115aea8 Fix Markdown list in README 2016-09-18 13:48:33 +02:00
Simon Schuster
94b0040d30 Hopefully fix githubs table rendering 2016-09-18 13:45:13 +02:00
Simon Schuster
4ee53658d8 Explain the name 2016-09-18 13:43:14 +02:00
Simon Schuster
e3327ad326 Mention the ansible.cfg in the README 2016-09-18 13:27:06 +02:00
Simon Schuster
2252ae1625 add a hostsfile for the vagrant vm 2016-09-18 13:24:35 +02:00
Simon Schuster
c160b86321 Add a simple playbook example 2016-09-18 13:24:02 +02:00
Simon Schuster
3c6bbce63c Add the fatpacked libraries to .gitignore 2016-09-18 13:22:50 +02:00
Simon Schuster
100be01f25 Add the library directory 2016-09-18 13:22:07 +02:00
Simon Schuster
b48d89d3d8 Add the section-type alias in the uci module 2016-09-18 13:20:45 +02:00
Simon Schuster
7a45984a4b Added LICENSE 2016-09-18 13:20:12 +02:00
Simon Schuster
f9ccce5667 Added .gitignore 2016-09-18 13:20:01 +02:00
Simon Schuster
c9d219ccbf README added 2016-09-18 13:19:34 +02:00
Simon Schuster
82107b01e2 Added testing submodule 2016-09-08 13:18:08 +02:00
Simon Schuster
ba86c0e09b Added a simple filter example 2016-09-08 11:06:15 +02:00
Simon Schuster
cb07259be5 Added (basic) makefile 2016-09-08 11:00:33 +02:00
Simon Schuster
3c105b9bcc Added example ansible.cfg 2016-09-08 11:00:01 +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