Skip to content

Instantly share code, notes, and snippets.

View xakrume's full-sized avatar
emerge -auDN @world

Ruslan Kh. xakrume

emerge -auDN @world
View GitHub Profile
@xakrume
xakrume / promtail.yaml
Created May 15, 2023 13:33
medium:promtail.yaml.j2
pipeline_stages:
- logfmt:
mapping:
timestamp: time
level:
- match:
...
- match:
selector: '{job="exporters"}'
stages:
@xakrume
xakrume / promtail.yaml
Last active May 28, 2023 19:45
ansible-promtail.yaml
pipeline_stages:
- logfmt:
mapping:
timestamp: time
level:
- match:
...
- match:
selector: '{job="exporters"}'
stages:
@xakrume
xakrume / nginx-proxy-geoip
Created May 23, 2018 23:27 — forked from gjuric/nginx-proxy-geoip
nginx - pass GEOIP headers to proxy host
# http block
geoip_city /usr/local/share/GeoIP/GeoIPCity.dat;
geoip_country /usr/local/share/GeoIP/GeoIPCountry.dat;
# location block
proxy_set_header GEOIP_COUNTRY_CODE $geoip_country_code;
proxy_set_header GEOIP_COUNTRY_CODE3 $geoip_country_code3;
proxy_set_header GEOIP_COUNTRY_NAME $geoip_country_name;
Системный журнал
Функция автоматической отправки почты: Отключена
Тип журнала: Уровень журнала:
Индекс Время Тип Уровень Содержание журнала
39 1st day 00:05:36 DHCP ПРИМЕЧАНИЕ Dynamic IP(DHCP Client) obtained an IP successfully
38 1st day 00:05:36 DHCP ИНФО Mark the ip 64549230 for option 50.
37 1st day 00:05:36 DHCP ИНФО DHCPC:GET ip:64549230 mask:ffff8000 gateway:64548001 dns1:5515c003 dns2:d5eac008 static route:0
36 1st day 00:05:36 DHCP ИНФО DHCPC Recv ACK from server 4e6b91f9 with ip 64549230 lease time 600
fatal: [example.eu]: FAILED! => {
"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'stdout'\n\nThe error appears to have been in '/Users/default/Documents/repoitories/ansible/roles/mytask/tasks/main.yml': line 27, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- local_action: copy content=\"{{ command_result.stdout }}\" dest=/tmp/test\n ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote template expression brackets when they\nstart a value. For instance:\n\n with_items:\n - {{ foo }}\n\nShould be written as:\n\n with_items:\n - \"{{ foo }}\"\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'dict object' has no attribute 'stdout'"
}
- name: "Manage SSH known_hosts file"
command: "/usr/bin/ssh-keyscan -t ecdsa {{ item.ssh_config_vars.0.hostname }}"
with_items:
- "{{ grafana_indirect_maps }}"
register: command_result
- local_action: copy content="{{ command_result.stdout }}" dest=/tmp/test
grafana_indirect_maps:
# example.com
- name: "example.com"
ssh_config_vars:
- host: "example.com"
port: "22"
user: "user"
hostname: "10.0.0.17"
hostkeyalias: "example.com"
- name: "example.net"
@xakrume
xakrume / ansible-summary.md
Created October 12, 2017 12:00 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

#!/bin/bash -x
# based on: http://superuser.com/questions/386506/hosting-iscsi-on-smartos
GROUPNAME=iscsi-1
TARGETNAME=iqn.2010-08.org.illumos:02:$GROUPNAME
LOCAL_ADDRESS=192.168.1.2
svcadm enable stmf
svcadm enable -r svc:/network/iscsi/target:default