Created
February 15, 2023 22:02
-
-
Save veerendra2/19d9bdbb5b10cd36476342843c57c05a to your computer and use it in GitHub Desktop.
Enable userns-remap Ansible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Enable userns-remap | |
hosts: localhost | |
connection: local | |
gather_facts: yes | |
tasks: | |
- block: | |
- name: Update userns-remap config | |
shell: | | |
cp /etc/docker/daemon.json /etc/docker/daemon.json.backup | |
jq '. += { "userns-remap" : "default" }' < /etc/docker/daemon.json > /tmp/daemon.json | |
mv /tmp/daemon.json /etc/docker/daemon.json | |
rescue: | |
- name: Create /etc/docker/daemon.json and configure userns-remap | |
blockinfile: | |
path: /etc/docker/daemon.json | |
marker: "" | |
create: yes | |
block: | | |
{ | |
"userns-remap": "default" | |
} | |
become: yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment