git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
More detailed version: https://til.simonwillison.net/git/git-archive
--- | |
- hosts: | |
- all | |
become: true | |
tasks: | |
- name: Update apt cache | |
apt: update_cache=yes | |
- name: Upgrade packages | |
apt: upgrade=dist |
docker logs nginx 2>&1 | grep "127." | |
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container |
map $http_origin $allow_origin { | |
default "$http_origin"; | |
} | |
map $request_method $cors_method { | |
default "allowed"; | |
"OPTIONS" "preflight"; | |
} | |
map $cors_method $cors_max_age { |
git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
More detailed version: https://til.simonwillison.net/git/git-archive
Would like to be able to check contents of json.items.*.labels[*] and json.items.*.labels[*].value from json below: | |
I'm unsure how to get the contents of the generator from ansible / jinja2. | |
- name: Test json | |
debug: "msg={{ json.items|map(attribute='metadata.labels') }}" | |
$ ansible-playbook -i inv/dev k8s-redis.yml --extra-vars "@test-var.json" | |
Gives me: |
--- | |
- name: Ansible tests playbook | |
hosts: all | |
remote_user: root | |
tasks: | |
- name: Check if mariadb-libs-5.5.44-2.el7.centos.x86_64 package is installed | |
yum: | |
list=mariadb-libs-5.5*x86_64 | |
register: pkg |
root@deployServer:~# salt \* state.highstate --output=summary_highstate | |
web-server01.example.com ------------------ Success: 20 Changed: 0 Errors: 0 | |
web-server02.example.com ------------------ Success: 71 Changed: 1 Errors: 0 | |
db-server03.example.com ------------------- Success: 73 Changed: 1 Errors: 0 | |
mongo-server04.example.com ---------------- Success: 74 Changed: 1 Errors: 0 | |
mongo-server05.example.com ---------------- Success: 74 Changed: 1 Errors: 0 | |
memcache-server06.example.com ------------- Success: 74 Changed: 1 Errors: 0 | |
mysql-server07.example.com ---------------- Success: 74 Changed: 1 Errors: 0 | |
logs-server08.example.com ----------------- Success: 20 Changed: 0 Errors: 0 | |
redis-server09.example.com ---------------- Success: 27 Changed: 0 Errors: 0 |
简明 Python 教程: http://woodpecker.org.cn/abyteofpython_cn/chinese/
一开始通读一遍这个很不错,是最简单明确的 Python 教程,最适合快速了解。