{
    "version": "https:\/\/jsonfeed.org\/version\/1.1",
    "title": "M9K blog: заметки с тегом ansible",
    "_rss_description": "Заметки обо всём: devops, lifestyle, культура.",
    "_rss_language": "ru",
    "_itunes_email": "",
    "_itunes_categories_xml": "",
    "_itunes_image": "",
    "_itunes_explicit": "",
    "home_page_url": "https:\/\/blog.m9k.space\/tags\/ansible\/",
    "feed_url": "https:\/\/blog.m9k.space\/tags\/ansible\/json\/",
    "icon": "https:\/\/blog.m9k.space\/pictures\/userpic\/userpic@2x.jpg?1769095194",
    "authors": [
        {
            "name": "M",
            "url": "https:\/\/blog.m9k.space\/",
            "avatar": "https:\/\/blog.m9k.space\/pictures\/userpic\/userpic@2x.jpg?1769095194"
        }
    ],
    "items": [
        {
            "id": "147",
            "url": "https:\/\/blog.m9k.space\/all\/gitlab-runner-with-ansible-kerberos\/",
            "title": "GitLab Runner with Ansible & Kerberos",
            "content_html": "<pre class=\"e2-text-code\"><code class=\"\">FROM alpine:3.16\n\nRUN apk update &amp;&amp; \\\napk add --no-cache git gitlab-runner ansible gawk krb5 dumb-init &amp;&amp; \\\napk add --upgrade openssh-client-krb5 &amp;&amp; \\\nrm -rf \/tmp\/* &amp;&amp; \\\nrm -rf \/var\/cache\/apk\/*\n\nRUN sed -i -e &quot;s#\\(^gitlab-runner:x\\):[^:]\\+:\\(.*\\)#\\1:1010:\\2#&quot; \/etc\/group\nRUN sed -i -e &quot;s#\\(^gitlab-runner:x\\):[^:]\\+:[^:]\\+:\\(.*\\)#\\1:1010:1010:\\2#&quot; \/etc\/passwd\nRUN chown -R 1010:1010 \/var\/lib\/gitlab-runner\n\nCOPY krb5.conf \/etc\/krb5.conf\nCOPY .gitconfig \/var\/lib\/gitlab-runner\/\nCOPY entrypoint \/\n\nSTOPSIGNAL SIGQUIT\nENTRYPOINT [&quot;\/usr\/bin\/dumb-init&quot;, &quot;\/entrypoint&quot;]\nCMD [&quot;run&quot;, &quot;--user=gitlab-runner&quot;, &quot;--working-directory=\/var\/lib\/gitlab-runner&quot;]<\/code><\/pre>",
            "summary": "",
            "date_published": "2023-10-20T17:08:08+07:00",
            "date_modified": "2023-10-20T17:07:57+07:00",
            "tags": [
                "ansible",
                "docker",
                "kerberos",
                "администрирование"
            ],
            "_date_published_rfc2822": "Fri, 20 Oct 2023 17:08:08 +0700",
            "_rss_guid_is_permalink": "false",
            "_rss_guid": "147",
            "_e2_data": {
                "is_favourite": false,
                "links_required": [
                    "highlight\/highlight.js",
                    "highlight\/highlight.css"
                ],
                "og_images": []
            }
        },
        {
            "id": "144",
            "url": "https:\/\/blog.m9k.space\/all\/j2-whitespace-control\/",
            "title": "j2 Whitespace Control",
            "content_html": "<p>Столкнулся с проблемой, что <i>if-else<\/i> condition отлично отрабатывает в рамках Ansible-скрипта, но при этом в выходном файле генерится после условия пустая строка. Поковырял <a href=\"https:\/\/jinja.palletsprojects.com\/en\/3.0.x\/templates\/#whitespace-control\">ман<\/a>, называется это <i>trim_blocks<\/i> и <i>lstrip_blocks<\/i> соответственно.<br \/>\nВыглядит следующим образом:<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">&lt;div&gt;\n    {% if True %}\n        yay\n    {% endif %}\n&lt;\/div&gt;<\/code><\/pre><pre class=\"e2-text-code\"><code class=\"\">&lt;div&gt;\n\n        yay\n\n&lt;\/div&gt;<\/code><\/pre><p>Лечится магическим символом:<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">-<\/code><\/pre><p>В случае с генерируемым из темплейта Ansible-файла:<\/p>\n<pre class=\"e2-text-code\"><code class=\"\">{% if variable== &#039;value&#039; %}\n    &quot;bla&quot;\n{% else %}\n    &quot;bla-bla&quot;\n{% endif -%}<\/code><\/pre>",
            "summary": "Столкнулся с проблемой, что if-else condition отлично отрабатывает в рамках Ansible-скрипта, но при этом в выходном файле генерится после условия пустая строка",
            "date_published": "2023-10-19T17:48:54+07:00",
            "date_modified": "2023-10-19T17:52:43+07:00",
            "tags": [
                "ansible",
                "DevOps",
                "j2",
                "Jinja",
                "администрирование"
            ],
            "_date_published_rfc2822": "Thu, 19 Oct 2023 17:48:54 +0700",
            "_rss_guid_is_permalink": "false",
            "_rss_guid": "144",
            "_e2_data": {
                "is_favourite": false,
                "links_required": [
                    "highlight\/highlight.js",
                    "highlight\/highlight.css"
                ],
                "og_images": []
            }
        }
    ],
    "_e2_version": 4199,
    "_e2_ua_string": "Aegea 11.5 (v4199)"
}