geerlingguy / ansible-role-raspberry-pi

Configures a Raspberry Pi (running Raspbian).
https://galaxy.ansible.com/geerlingguy/raspberry-pi/
MIT License
107 stars 19 forks source link

Add variable for setting backrefs #4

Closed jason-riddle closed 3 years ago

jason-riddle commented 4 years ago

While inspecting raspberry-pi-dramble/tasks/cgroup-features.yml (0af982d), there's the following:

- name: Enable required cgroup features.
  lineinfile:
    path: /boot/cmdline.txt
    backrefs: True
    regexp: '(^.+rootwait(\s+(?!cgroup_enable=cpuset cgroup_enable=memory)[\w=/\-\.]+)*)\s*$'
    line: '\1 cgroup_enable=cpuset cgroup_enable=memory'
    state: present

This code block code be replaced by this role and with the following variable definition

raspberry_pi_boot_config_options:
  # Enable required cgroup features.
  - regexp: '(^.+rootwait(\s+(?!cgroup_enable=cpuset cgroup_enable=memory)[\w=/\-\.]+)*)\s*$'
    line: '\1 cgroup_enable=cpuset cgroup_enable=memory'
    backrefs: True

However, the backrefs: True does not exist as an option today. Happy to contribute a PR to add this, but wanted to get some feedback on this change first.

adam-moss commented 4 years ago

That would remove a task for another playbook I have, so would be a nice addition.

stale[bot] commented 4 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 3 years ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.