Ansible instructions to merge two json files.
Assumes files: original.json, merge.json and new.json
---
- name: get content of original file
slurp:
src: "original.json"
register: original_config
| [Unit] | |
| Description=Docker Application Container Engine | |
| Documentation=https://docs.docker.com | |
| After=network-online.target docker.socket firewalld.service containerd.service time-set.target | |
| Wants=network-online.target containerd.service | |
| Requires=docker.socket | |
| [Service] | |
| Type=notify | |
| # the default is not to use systemd for cgroups because the delegate issues still |
| .RECIPEPREFIX = > | |
| .PHONY: all | |
| CFLAGS = -pedantic -Wall -Werror -Wstrict-prototypes -Wwrite-strings -Wshadow -Winit-self -Wcast-align -Wformat=2 -Wmissing-prototypes -Wstrict-overflow=2 -Wcast-qual -Wc++-compat -Wundef -Wswitch-default -Wconversion | |
| %.o : %.c | |
| > $(CC) -c $(CFLAGS) -o $@ $< | |
| all: helloworld | |
| helloworld: helloworld.c | |
| > $(CC) $(CFLAGS) -o $@ $< |
| #!/bin/bash | |
| # getdockerenv.sh v1.0 | |
| # 2021-06-23 - João Alves | |
| # This script sets a group of variables that can be useful in a containerized environment | |
| # It is specially tuned for docker but might (not tested) work in other environments | |
| # Exported variables: | |
| # CGROUPS - v1, v2, none |
Ansible instructions to merge two json files.
Assumes files: original.json, merge.json and new.json
---
- name: get content of original file
slurp:
src: "original.json"
register: original_config
To be able to send notifications to the logged in user you must add the file session-local.conf to folder /etc/dbus-1/session.d
Then you can use the command in notify-command.sh to display a message. Don't forget to match the UID with the one currently running the session.
This was tested in Fedora 31/32.
| from Crypto.Hash import MD5 | |
| from Crypto.Cipher import DES | |
| import base64 | |
| import random | |
| import sys | |
| def randomBytes(n): | |
| return bytearray(random.getrandbits(8) for i in range(n)) |
| for s in $(docker service ls --format "{{.Name}}"); do echo $s; docker service inspect $s --format '{{range .Spec.TaskTemplate.ContainerSpec.Secrets}}{{println " " .SecretName}}{{end}}'; done |
| FROM centos:7 AS BUILD | |
| ARG COMPILEFOLDER=/tmp/build | |
| ARG INSTALLBASESSHD=/opt/.ssh | |
| ARG INSTALLBASESSSL=/opt/.ssl | |
| RUN yum -y -q install gcc make perl glibc-static wget | |
| RUN mkdir -p "$COMPILEFOLDER/root" |