Update: Jupyter playbook
This commit is contained in:
parent
34587710b3
commit
00f87bb4f7
@ -10,7 +10,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 1,
|
"execution_count": 3,
|
||||||
"id": "98d4907b",
|
"id": "98d4907b",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -18,12 +18,12 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"/home/jez/volumes/data/prj/bell/training/tiger-ansible/ext/kheops\n"
|
"/home/jez/prj/bell/dev/kheops\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"cd /home/jez/volumes/data/prj/bell/training/tiger-ansible/ext/kheops\n",
|
"cd ${KHEOPS_EXAMPLES_DIR:-/dev/null}\n",
|
||||||
"echo $PWD\n",
|
"echo $PWD\n",
|
||||||
"export KHEOPS_NAMESPACE=ex1_enc \n",
|
"export KHEOPS_NAMESPACE=ex1_enc \n",
|
||||||
"export KHEOPS_CONFIG=examples/kheops.yml\n",
|
"export KHEOPS_CONFIG=examples/kheops.yml\n",
|
||||||
@ -48,7 +48,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 2,
|
"execution_count": 4,
|
||||||
"id": "6ede46a3",
|
"id": "6ede46a3",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -56,22 +56,24 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"usage: kheops [-h] [-v] [-c CONFIG]\n",
|
"Usage: kheops [OPTIONS] COMMAND [ARGS]...\n",
|
||||||
" {schema,gen_doc,lookup,demo,subcommand2} ...\n",
|
|
||||||
"\n",
|
"\n",
|
||||||
"Kheops, hierarchical data lookup tool\n",
|
" Khéops, hierarchical key/value store\n",
|
||||||
"\n",
|
"\n",
|
||||||
"options:\n",
|
"Options:\n",
|
||||||
" -h, --help show this help message and exit\n",
|
" -v, --verbose [default: 0]\n",
|
||||||
" -v, --verbose Increase verbosity (KHEOPS_VERBOSE) (default: 0)\n",
|
" -c PATH Last name of person to greet. [env var:\n",
|
||||||
" -c CONFIG, --config CONFIG\n",
|
" KHEOPS_CONFIG; default: kheops.yml]\n",
|
||||||
" Kheops configuration file (KHEOPS_CONFIG) (default:\n",
|
" --install-completion [bash|zsh|fish|powershell|pwsh]\n",
|
||||||
" examples/kheops.yml)\n",
|
" Install completion for the specified shell.\n",
|
||||||
|
" --show-completion [bash|zsh|fish|powershell|pwsh]\n",
|
||||||
|
" Show completion for the specified shell, to\n",
|
||||||
|
" copy it or customize the installation.\n",
|
||||||
|
" --help Show this message and exit.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"subcommands:\n",
|
"Commands:\n",
|
||||||
" valid subcommands\n",
|
" config\n",
|
||||||
"\n",
|
" lookup Lookup database\n"
|
||||||
" {schema,gen_doc,lookup,demo,subcommand2}\n"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -149,14 +151,6 @@
|
|||||||
"A scope is completely optional while keys are required."
|
"A scope is completely optional while keys are required."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "9e6aae44",
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "d509fa19",
|
"id": "d509fa19",
|
||||||
@ -165,9 +159,35 @@
|
|||||||
"## Basic hierarchy"
|
"## Basic hierarchy"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "8dd5b6b9",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"Let's create a firest hierachy, we will define a first basic hierarchy. In `kheops.yml`, we can find:\n",
|
||||||
|
"\n",
|
||||||
|
"```\n",
|
||||||
|
"ex1_enc:\n",
|
||||||
|
" \n",
|
||||||
|
" config:\n",
|
||||||
|
" file_path_prefix: \"ex1_enc/\"\n",
|
||||||
|
" file_path_suffix: \"/ansible\"\n",
|
||||||
|
"\n",
|
||||||
|
" lookups:\n",
|
||||||
|
"\n",
|
||||||
|
" - path: default # Simplest form, just a path\n",
|
||||||
|
" - path: \"roles/{role}\" # If list, it's auto expanded like in bash\n",
|
||||||
|
" - path: \"env_{env}\" # If list, it's auto expanded like in bash\n",
|
||||||
|
" - path: \"nodes/{node}\"\n",
|
||||||
|
"\n",
|
||||||
|
"```\n",
|
||||||
|
"\n",
|
||||||
|
"Now we have our hierachy, let's create our files:"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 3,
|
"execution_count": 9,
|
||||||
"id": "e510a46d",
|
"id": "e510a46d",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -175,7 +195,7 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"\u001b[01;34mexamples/ex1_enc\u001b[00m\n",
|
"\u001b[01;34mexamples/ex1_enc\u001b[0m\n",
|
||||||
"└── default.yml\n",
|
"└── default.yml\n",
|
||||||
"\n",
|
"\n",
|
||||||
"0 directories, 1 file\n",
|
"0 directories, 1 file\n",
|
||||||
@ -217,7 +237,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 4,
|
"execution_count": 8,
|
||||||
"id": "06d85b1c",
|
"id": "06d85b1c",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -225,6 +245,7 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
|
"profile:\n",
|
||||||
" env: NO_ENV\n",
|
" env: NO_ENV\n",
|
||||||
" product: NO_PRODUCT\n",
|
" product: NO_PRODUCT\n",
|
||||||
"\n"
|
"\n"
|
||||||
@ -245,7 +266,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 5,
|
"execution_count": 10,
|
||||||
"id": "c5fad63b",
|
"id": "c5fad63b",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -253,6 +274,7 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
|
"profile:\n",
|
||||||
" env: NO_ENV\n",
|
" env: NO_ENV\n",
|
||||||
" product: NO_PRODUCT\n",
|
" product: NO_PRODUCT\n",
|
||||||
"\n"
|
"\n"
|
||||||
@ -263,6 +285,14 @@
|
|||||||
"kheops lookup -e node=web.infra.net profile"
|
"kheops lookup -e node=web.infra.net profile"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"id": "a0649351",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"Same result, let's check how we can change this behavior."
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "53c43757",
|
"id": "53c43757",
|
||||||
@ -281,7 +311,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 6,
|
"execution_count": 11,
|
||||||
"id": "9f5aabaa",
|
"id": "9f5aabaa",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -289,9 +319,9 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"\u001b[01;34mexamples/ex1_enc\u001b[00m\n",
|
"\u001b[01;34mexamples/ex1_enc\u001b[0m\n",
|
||||||
"├── default.yml\n",
|
"├── default.yml\n",
|
||||||
"└── \u001b[01;34mroles\u001b[00m\n",
|
"└── \u001b[01;34mroles\u001b[0m\n",
|
||||||
" ├── mysql.yml\n",
|
" ├── mysql.yml\n",
|
||||||
" └── web.yml\n",
|
" └── web.yml\n",
|
||||||
"\n",
|
"\n",
|
||||||
@ -336,7 +366,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 7,
|
"execution_count": 12,
|
||||||
"id": "4762fa0c",
|
"id": "4762fa0c",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -383,7 +413,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 8,
|
"execution_count": 13,
|
||||||
"id": "0294ec50",
|
"id": "0294ec50",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -391,6 +421,7 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
|
"profile:\n",
|
||||||
" env: NO_ENV\n",
|
" env: NO_ENV\n",
|
||||||
" product: httpd_server\n",
|
" product: httpd_server\n",
|
||||||
" web_top_domain: ''\n",
|
" web_top_domain: ''\n",
|
||||||
@ -399,6 +430,7 @@
|
|||||||
" web_user_list:\n",
|
" web_user_list:\n",
|
||||||
" - sysadmins\n",
|
" - sysadmins\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"profile:\n",
|
||||||
" env: NO_ENV\n",
|
" env: NO_ENV\n",
|
||||||
" product: mysql_server\n",
|
" product: mysql_server\n",
|
||||||
" mysql_database: NO_DATABASE\n",
|
" mysql_database: NO_DATABASE\n",
|
||||||
@ -436,7 +468,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 9,
|
"execution_count": 14,
|
||||||
"id": "c1acb199",
|
"id": "c1acb199",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -444,12 +476,12 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"\u001b[01;34mexamples/ex1_enc\u001b[00m\n",
|
"\u001b[01;34mexamples/ex1_enc\u001b[0m\n",
|
||||||
"├── default.yml\n",
|
"├── default.yml\n",
|
||||||
"├── \u001b[01;34mnodes\u001b[00m\n",
|
"├── \u001b[01;34mnodes\u001b[0m\n",
|
||||||
"│ ├── mysql.infra.net.yml\n",
|
"│ ├── mysql.infra.net.yml\n",
|
||||||
"│ └── web.infra.net.yml\n",
|
"│ └── web.infra.net.yml\n",
|
||||||
"└── \u001b[01;34mroles\u001b[00m\n",
|
"└── \u001b[01;34mroles\u001b[0m\n",
|
||||||
" ├── mysql.yml\n",
|
" ├── mysql.yml\n",
|
||||||
" └── web.yml\n",
|
" └── web.yml\n",
|
||||||
"\n",
|
"\n",
|
||||||
@ -495,7 +527,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 10,
|
"execution_count": 15,
|
||||||
"id": "b0d34416",
|
"id": "b0d34416",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -503,21 +535,21 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
|
"profile:\n",
|
||||||
" env: NO_ENV\n",
|
" env: NO_ENV\n",
|
||||||
" product: httpd_server\n",
|
" product: httpd_server\n",
|
||||||
" web_top_domain: ''\n",
|
" web_top_domain: ''\n",
|
||||||
" web_app: myapp\n",
|
" web_app: myapp\n",
|
||||||
" web_port: 80\n",
|
" web_port: 80\n",
|
||||||
" web_user_list:\n",
|
" web_user_list:\n",
|
||||||
"- sysadmins\n",
|
|
||||||
" - domain_org\n",
|
" - domain_org\n",
|
||||||
" - domain_org_external\n",
|
" - domain_org_external\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"profile:\n",
|
||||||
" env: NO_ENV\n",
|
" env: NO_ENV\n",
|
||||||
" product: mysql_server\n",
|
" product: mysql_server\n",
|
||||||
" mysql_database: app_domain_org\n",
|
" mysql_database: app_domain_org\n",
|
||||||
" mysql_users:\n",
|
" mysql_users:\n",
|
||||||
"- sysadmin@10.0.42%\n",
|
|
||||||
" - app_domain_org@10.0.51%\n",
|
" - app_domain_org@10.0.51%\n",
|
||||||
" mysql_port: 3306\n",
|
" mysql_port: 3306\n",
|
||||||
" mysql_cluster: false\n",
|
" mysql_cluster: false\n",
|
||||||
@ -548,7 +580,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 11,
|
"execution_count": 16,
|
||||||
"id": "6c92b0cc",
|
"id": "6c92b0cc",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -556,14 +588,14 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"\u001b[01;34mexamples/ex1_enc\u001b[00m\n",
|
"\u001b[01;34mexamples/ex1_enc\u001b[0m\n",
|
||||||
"├── default.yml\n",
|
"├── default.yml\n",
|
||||||
"├── env_dev.yml\n",
|
"├── env_dev.yml\n",
|
||||||
"├── env_prod.yml\n",
|
"├── env_prod.yml\n",
|
||||||
"├── \u001b[01;34mnodes\u001b[00m\n",
|
"├── \u001b[01;34mnodes\u001b[0m\n",
|
||||||
"│ ├── mysql.infra.net.yml\n",
|
"│ ├── mysql.infra.net.yml\n",
|
||||||
"│ └── web.infra.net.yml\n",
|
"│ └── web.infra.net.yml\n",
|
||||||
"└── \u001b[01;34mroles\u001b[00m\n",
|
"└── \u001b[01;34mroles\u001b[0m\n",
|
||||||
" ├── mysql.yml\n",
|
" ├── mysql.yml\n",
|
||||||
" └── web.yml\n",
|
" └── web.yml\n",
|
||||||
"\n",
|
"\n",
|
||||||
@ -619,7 +651,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 13,
|
"execution_count": 17,
|
||||||
"id": "9c3200b4",
|
"id": "9c3200b4",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -627,25 +659,24 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
|
"profile:\n",
|
||||||
" env: prod\n",
|
" env: prod\n",
|
||||||
" product: httpd_server\n",
|
" product: httpd_server\n",
|
||||||
" web_top_domain: infra.com\n",
|
" web_top_domain: infra.com\n",
|
||||||
" web_app: myapp\n",
|
" web_app: myapp\n",
|
||||||
" web_port: 80\n",
|
" web_port: 80\n",
|
||||||
" web_user_list:\n",
|
" web_user_list:\n",
|
||||||
"- sysadmins\n",
|
|
||||||
" - domain_org\n",
|
" - domain_org\n",
|
||||||
" - domain_org_external\n",
|
" - domain_org_external\n",
|
||||||
" web_cache: 12h\n",
|
" web_cache: 12h\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"profile:\n",
|
||||||
" env: dev\n",
|
" env: dev\n",
|
||||||
" product: httpd_server\n",
|
" product: httpd_server\n",
|
||||||
" web_top_domain: dev.infra.net\n",
|
" web_top_domain: dev.infra.net\n",
|
||||||
" web_app: myapp\n",
|
" web_app: myapp\n",
|
||||||
" web_port: 80\n",
|
" web_port: 80\n",
|
||||||
" web_user_list:\n",
|
" web_user_list:\n",
|
||||||
"- sysadmins\n",
|
|
||||||
"- debug_user\n",
|
|
||||||
" - domain_org\n",
|
" - domain_org\n",
|
||||||
" - domain_org_external\n",
|
" - domain_org_external\n",
|
||||||
" web_cache: 1m\n",
|
" web_cache: 1m\n",
|
||||||
@ -671,7 +702,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 14,
|
"execution_count": 18,
|
||||||
"id": "7c5e86f3",
|
"id": "7c5e86f3",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -679,23 +710,22 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
|
"profile:\n",
|
||||||
" env: prod\n",
|
" env: prod\n",
|
||||||
" product: mysql_server\n",
|
" product: mysql_server\n",
|
||||||
" mysql_database: app_domain_org\n",
|
" mysql_database: app_domain_org\n",
|
||||||
" mysql_users:\n",
|
" mysql_users:\n",
|
||||||
"- sysadmin@10.0.42%\n",
|
|
||||||
" - app_domain_org@10.0.51%\n",
|
" - app_domain_org@10.0.51%\n",
|
||||||
" mysql_port: 3306\n",
|
" mysql_port: 3306\n",
|
||||||
" mysql_cluster: false\n",
|
" mysql_cluster: false\n",
|
||||||
" web_top_domain: infra.com\n",
|
" web_top_domain: infra.com\n",
|
||||||
" web_cache: 12h\n",
|
" web_cache: 12h\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"profile:\n",
|
||||||
" env: dev\n",
|
" env: dev\n",
|
||||||
" product: mysql_server\n",
|
" product: mysql_server\n",
|
||||||
" mysql_database: app_domain_org\n",
|
" mysql_database: app_domain_org\n",
|
||||||
" mysql_users:\n",
|
" mysql_users:\n",
|
||||||
"- sysadmin@10.0.42%\n",
|
|
||||||
"- debug@10.0.%\n",
|
|
||||||
" - app_domain_org@10.0.51%\n",
|
" - app_domain_org@10.0.51%\n",
|
||||||
" mysql_port: 3306\n",
|
" mysql_port: 3306\n",
|
||||||
" mysql_cluster: false\n",
|
" mysql_cluster: false\n",
|
||||||
@ -713,22 +743,6 @@
|
|||||||
"kheops lookup -e node=mysql.infra.net -e role=mysql -e env=dev profile"
|
"kheops lookup -e node=mysql.infra.net -e role=mysql -e env=dev profile"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"cell_type": "markdown",
|
|
||||||
"id": "db50e110",
|
|
||||||
"metadata": {},
|
|
||||||
"source": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "c2c4658d",
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"\n"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "e4bf6d8d",
|
"id": "e4bf6d8d",
|
||||||
@ -739,7 +753,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 15,
|
"execution_count": 19,
|
||||||
"id": "103cb37d",
|
"id": "103cb37d",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -747,15 +761,18 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
|
"profile:\n",
|
||||||
" env: NO_ENV\n",
|
" env: NO_ENV\n",
|
||||||
" product: NO_PRODUCT\n",
|
" product: NO_PRODUCT\n",
|
||||||
"\n",
|
"\n",
|
||||||
"==> Per environment view\n",
|
"==> Per environment view\n",
|
||||||
|
"profile:\n",
|
||||||
" env: prod\n",
|
" env: prod\n",
|
||||||
" product: NO_PRODUCT\n",
|
" product: NO_PRODUCT\n",
|
||||||
" web_top_domain: infra.com\n",
|
" web_top_domain: infra.com\n",
|
||||||
" web_cache: 12h\n",
|
" web_cache: 12h\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"profile:\n",
|
||||||
" env: dev\n",
|
" env: dev\n",
|
||||||
" product: NO_PRODUCT\n",
|
" product: NO_PRODUCT\n",
|
||||||
" web_top_domain: dev.infra.net\n",
|
" web_top_domain: dev.infra.net\n",
|
||||||
@ -767,6 +784,7 @@
|
|||||||
" debug: true\n",
|
" debug: true\n",
|
||||||
"\n",
|
"\n",
|
||||||
"==> Per role and environment view\n",
|
"==> Per role and environment view\n",
|
||||||
|
"profile:\n",
|
||||||
" env: prod\n",
|
" env: prod\n",
|
||||||
" product: mysql_server\n",
|
" product: mysql_server\n",
|
||||||
" mysql_database: NO_DATABASE\n",
|
" mysql_database: NO_DATABASE\n",
|
||||||
@ -777,6 +795,7 @@
|
|||||||
" web_top_domain: infra.com\n",
|
" web_top_domain: infra.com\n",
|
||||||
" web_cache: 12h\n",
|
" web_cache: 12h\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"profile:\n",
|
||||||
" env: prod\n",
|
" env: prod\n",
|
||||||
" product: httpd_server\n",
|
" product: httpd_server\n",
|
||||||
" web_top_domain: infra.com\n",
|
" web_top_domain: infra.com\n",
|
||||||
@ -787,14 +806,13 @@
|
|||||||
" web_cache: 12h\n",
|
" web_cache: 12h\n",
|
||||||
"\n",
|
"\n",
|
||||||
"==> Per node view\n",
|
"==> Per node view\n",
|
||||||
|
"profile:\n",
|
||||||
" env: dev\n",
|
" env: dev\n",
|
||||||
" product: httpd_server\n",
|
" product: httpd_server\n",
|
||||||
" web_top_domain: dev.infra.net\n",
|
" web_top_domain: dev.infra.net\n",
|
||||||
" web_app: myapp\n",
|
" web_app: myapp\n",
|
||||||
" web_port: 80\n",
|
" web_port: 80\n",
|
||||||
" web_user_list:\n",
|
" web_user_list:\n",
|
||||||
"- sysadmins\n",
|
|
||||||
"- debug_user\n",
|
|
||||||
" - domain_org\n",
|
" - domain_org\n",
|
||||||
" - domain_org_external\n",
|
" - domain_org_external\n",
|
||||||
" web_cache: 1m\n",
|
" web_cache: 1m\n",
|
||||||
@ -902,7 +920,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 19,
|
"execution_count": 21,
|
||||||
"id": "52f5033b",
|
"id": "52f5033b",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -911,6 +929,7 @@
|
|||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"+ : Find where a key has been defined\n",
|
"+ : Find where a key has been defined\n",
|
||||||
|
"+ : ==========================\n",
|
||||||
"+ grep --colour=auto -r '^profile:' examples/ex1_enc\n",
|
"+ grep --colour=auto -r '^profile:' examples/ex1_enc\n",
|
||||||
"\u001b[35m\u001b[Kexamples/ex1_enc/env_prod.yml\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[K\u001b[01;31m\u001b[Kprofile:\u001b[m\u001b[K\n",
|
"\u001b[35m\u001b[Kexamples/ex1_enc/env_prod.yml\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[K\u001b[01;31m\u001b[Kprofile:\u001b[m\u001b[K\n",
|
||||||
"\u001b[35m\u001b[Kexamples/ex1_enc/roles/mysql.yml\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[K\u001b[01;31m\u001b[Kprofile:\u001b[m\u001b[K\n",
|
"\u001b[35m\u001b[Kexamples/ex1_enc/roles/mysql.yml\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[K\u001b[01;31m\u001b[Kprofile:\u001b[m\u001b[K\n",
|
||||||
@ -920,6 +939,7 @@
|
|||||||
"\u001b[35m\u001b[Kexamples/ex1_enc/default.yml\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[K\u001b[01;31m\u001b[Kprofile:\u001b[m\u001b[K\n",
|
"\u001b[35m\u001b[Kexamples/ex1_enc/default.yml\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[K\u001b[01;31m\u001b[Kprofile:\u001b[m\u001b[K\n",
|
||||||
"\u001b[35m\u001b[Kexamples/ex1_enc/env_dev.yml\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[K\u001b[01;31m\u001b[Kprofile:\u001b[m\u001b[K\n",
|
"\u001b[35m\u001b[Kexamples/ex1_enc/env_dev.yml\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[K\u001b[01;31m\u001b[Kprofile:\u001b[m\u001b[K\n",
|
||||||
"+ : Find where a key has been defined and 5 first lines\n",
|
"+ : Find where a key has been defined and 5 first lines\n",
|
||||||
|
"+ : ==========================\n",
|
||||||
"+ grep --colour=auto -r -A 5 web_user_list: examples/ex1_enc\n",
|
"+ grep --colour=auto -r -A 5 web_user_list: examples/ex1_enc\n",
|
||||||
"\u001b[35m\u001b[Kexamples/ex1_enc/roles/web.yml\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[K \u001b[01;31m\u001b[Kweb_user_list:\u001b[m\u001b[K\n",
|
"\u001b[35m\u001b[Kexamples/ex1_enc/roles/web.yml\u001b[m\u001b[K\u001b[36m\u001b[K:\u001b[m\u001b[K \u001b[01;31m\u001b[Kweb_user_list:\u001b[m\u001b[K\n",
|
||||||
"\u001b[35m\u001b[Kexamples/ex1_enc/roles/web.yml\u001b[m\u001b[K\u001b[36m\u001b[K-\u001b[m\u001b[K - sysadmins\n",
|
"\u001b[35m\u001b[Kexamples/ex1_enc/roles/web.yml\u001b[m\u001b[K\u001b[36m\u001b[K-\u001b[m\u001b[K - sysadmins\n",
|
||||||
@ -937,6 +957,7 @@
|
|||||||
"\u001b[35m\u001b[Kexamples/ex1_enc/env_dev.yml\u001b[m\u001b[K\u001b[36m\u001b[K-\u001b[m\u001b[K\n",
|
"\u001b[35m\u001b[Kexamples/ex1_enc/env_dev.yml\u001b[m\u001b[K\u001b[36m\u001b[K-\u001b[m\u001b[K\n",
|
||||||
"\u001b[35m\u001b[Kexamples/ex1_enc/env_dev.yml\u001b[m\u001b[K\u001b[36m\u001b[K-\u001b[m\u001b[K debug: true\n",
|
"\u001b[35m\u001b[Kexamples/ex1_enc/env_dev.yml\u001b[m\u001b[K\u001b[36m\u001b[K-\u001b[m\u001b[K debug: true\n",
|
||||||
"+ : Search from anything related to database\n",
|
"+ : Search from anything related to database\n",
|
||||||
|
"+ : ==========================\n",
|
||||||
"+ grep --colour=auto -R -C 3 database examples/ex1_enc\n",
|
"+ grep --colour=auto -R -C 3 database examples/ex1_enc\n",
|
||||||
"\u001b[35m\u001b[Kexamples/ex1_enc/roles/mysql.yml\u001b[m\u001b[K\u001b[36m\u001b[K-\u001b[m\u001b[Kprofile:\n",
|
"\u001b[35m\u001b[Kexamples/ex1_enc/roles/mysql.yml\u001b[m\u001b[K\u001b[36m\u001b[K-\u001b[m\u001b[Kprofile:\n",
|
||||||
"\u001b[35m\u001b[Kexamples/ex1_enc/roles/mysql.yml\u001b[m\u001b[K\u001b[36m\u001b[K-\u001b[m\u001b[K product: \"mysql_server\"\n",
|
"\u001b[35m\u001b[Kexamples/ex1_enc/roles/mysql.yml\u001b[m\u001b[K\u001b[36m\u001b[K-\u001b[m\u001b[K product: \"mysql_server\"\n",
|
||||||
@ -960,12 +981,17 @@
|
|||||||
"set -x\n",
|
"set -x\n",
|
||||||
"\n",
|
"\n",
|
||||||
": Find where a key has been defined\n",
|
": Find where a key has been defined\n",
|
||||||
|
": ==========================\n",
|
||||||
"grep -r '^profile:' examples/$KHEOPS_NAMESPACE\n",
|
"grep -r '^profile:' examples/$KHEOPS_NAMESPACE\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"\n",
|
||||||
": Find where a key has been defined and 5 first lines\n",
|
": Find where a key has been defined and 5 first lines\n",
|
||||||
|
": ==========================\n",
|
||||||
"grep -r -A 5 'web_user_list:' examples/$KHEOPS_NAMESPACE\n",
|
"grep -r -A 5 'web_user_list:' examples/$KHEOPS_NAMESPACE\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"\n",
|
||||||
": Search from anything related to database\n",
|
": Search from anything related to database\n",
|
||||||
|
": ==========================\n",
|
||||||
"grep -R -C 3 'database' examples/$KHEOPS_NAMESPACE\n",
|
"grep -R -C 3 'database' examples/$KHEOPS_NAMESPACE\n",
|
||||||
"\n",
|
"\n",
|
||||||
"set +x"
|
"set +x"
|
||||||
@ -989,7 +1015,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 18,
|
"execution_count": 22,
|
||||||
"id": "49bc3fc3",
|
"id": "49bc3fc3",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -1050,7 +1076,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 17,
|
"execution_count": 23,
|
||||||
"id": "e4a1e8d1",
|
"id": "e4a1e8d1",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -1058,9 +1084,10 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"--- /dev/fd/63\t2022-02-01 20:10:53.094525316 -0500\n",
|
"--- /dev/fd/63\t2022-02-14 13:45:59.223619144 -0500\n",
|
||||||
"+++ /dev/fd/62\t2022-02-01 20:10:53.094525316 -0500\n",
|
"+++ /dev/fd/62\t2022-02-14 13:45:59.223619144 -0500\n",
|
||||||
"@@ -1,11 +1,15 @@\n",
|
"@@ -1,11 +1,14 @@\n",
|
||||||
|
" profile:\n",
|
||||||
"- env: prod\n",
|
"- env: prod\n",
|
||||||
"+ env: dev\n",
|
"+ env: dev\n",
|
||||||
" product: httpd_server\n",
|
" product: httpd_server\n",
|
||||||
@ -1069,8 +1096,6 @@
|
|||||||
" web_app: myapp\n",
|
" web_app: myapp\n",
|
||||||
" web_port: 80\n",
|
" web_port: 80\n",
|
||||||
" web_user_list:\n",
|
" web_user_list:\n",
|
||||||
" - sysadmins\n",
|
|
||||||
"+- debug_user\n",
|
|
||||||
" - domain_org\n",
|
" - domain_org\n",
|
||||||
" - domain_org_external\n",
|
" - domain_org_external\n",
|
||||||
"- web_cache: 12h\n",
|
"- web_cache: 12h\n",
|
||||||
@ -1094,14 +1119,6 @@
|
|||||||
"<(kheops lookup -e node=web.infra.net -e role=web -e env=dev profile)"
|
"<(kheops lookup -e node=web.infra.net -e role=web -e env=dev profile)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "a6feb212",
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"id": "12b1730b",
|
"id": "12b1730b",
|
||||||
@ -1112,7 +1129,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 21,
|
"execution_count": 25,
|
||||||
"id": "3ac0cc53",
|
"id": "3ac0cc53",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@ -1149,11 +1166,11 @@
|
|||||||
"+------------------------+------------------------------+\n",
|
"+------------------------+------------------------------+\n",
|
||||||
" INFO: Explain candidates:\n",
|
" INFO: Explain candidates:\n",
|
||||||
"+----------------------------------------------------------------------------------+-------------------------------+------------------------------+\n",
|
"+----------------------------------------------------------------------------------+-------------------------------+------------------------------+\n",
|
||||||
"| Status | Runtime | Data |\n",
|
"| Status | Runtime | Key Value |\n",
|
||||||
"+----------------------------------------------------------------------------------+-------------------------------+------------------------------+\n",
|
"+----------------------------------------------------------------------------------+-------------------------------+------------------------------+\n",
|
||||||
"| | | |\n",
|
"| | | |\n",
|
||||||
"| Status:{ | Runtime:{ | Data:{ |\n",
|
"| Status:{ | Runtime:{ | Key:{ |\n",
|
||||||
"| \"path\": \"/home/jez/volumes/data/prj/bell/training/tiger-ansible/ext/kheops ... | \"scope\": { | \"env\": \"NO_ENV\", |\n",
|
"| \"path\": \"/home/jez/volumes/data/prj/bell/dev/kheops/examples/ex1_enc/defau ... | \"scope\": { | \"env\": \"NO_ENV\", |\n",
|
||||||
"| \"status\": \"found\", | \"role\": \"web\" | \"product\": \"NO_PRODUCT\" |\n",
|
"| \"status\": \"found\", | \"role\": \"web\" | \"product\": \"NO_PRODUCT\" |\n",
|
||||||
"| \"rel_path\": \"examples/ex1_enc/default.yml\" | }, | } |\n",
|
"| \"rel_path\": \"examples/ex1_enc/default.yml\" | }, | } |\n",
|
||||||
"| } | \"key\": \"profile\", | |\n",
|
"| } | \"key\": \"profile\", | |\n",
|
||||||
@ -1164,8 +1181,8 @@
|
|||||||
"| | \"backend_index\": 0 | |\n",
|
"| | \"backend_index\": 0 | |\n",
|
||||||
"| | } | |\n",
|
"| | } | |\n",
|
||||||
"| | | |\n",
|
"| | | |\n",
|
||||||
"| Status:{ | Runtime:{ | Data:{ |\n",
|
"| Status:{ | Runtime:{ | Key:{ |\n",
|
||||||
"| \"path\": \"/home/jez/volumes/data/prj/bell/training/tiger-ansible/ext/kheops ... | \"scope\": { | \"product\": \"httpd_server\", |\n",
|
"| \"path\": \"/home/jez/volumes/data/prj/bell/dev/kheops/examples/ex1_enc/roles ... | \"scope\": { | \"product\": \"httpd_server\", |\n",
|
||||||
"| \"status\": \"found\", | \"role\": \"web\" | \"web_top_domain\": \"\", |\n",
|
"| \"status\": \"found\", | \"role\": \"web\" | \"web_top_domain\": \"\", |\n",
|
||||||
"| \"rel_path\": \"examples/ex1_enc/roles/web.yml\" | }, | \"web_app\": \"NO_APP\", |\n",
|
"| \"rel_path\": \"examples/ex1_enc/roles/web.yml\" | }, | \"web_app\": \"NO_APP\", |\n",
|
||||||
"| } | \"key\": \"profile\", | \"web_port\": 80, |\n",
|
"| } | \"key\": \"profile\", | \"web_port\": 80, |\n",
|
||||||
@ -1176,6 +1193,7 @@
|
|||||||
"| | \"backend_index\": 1 | |\n",
|
"| | \"backend_index\": 1 | |\n",
|
||||||
"| | } | |\n",
|
"| | } | |\n",
|
||||||
"+----------------------------------------------------------------------------------+-------------------------------+------------------------------+\n",
|
"+----------------------------------------------------------------------------------+-------------------------------+------------------------------+\n",
|
||||||
|
"profile:\n",
|
||||||
" env: NO_ENV\n",
|
" env: NO_ENV\n",
|
||||||
" product: httpd_server\n",
|
" product: httpd_server\n",
|
||||||
" web_top_domain: ''\n",
|
" web_top_domain: ''\n",
|
||||||
@ -1188,13 +1206,13 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"kheops lookup -e role=web profile -x"
|
"kheops lookup -e role=web profile -X"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"id": "cb111da7",
|
"id": "07eeed03",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": []
|
"source": []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user