<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>SysAdmin and DevOps</title>
    <description>My Personal Blog</description>
    <link>https://rpanev.pro/</link>
    <atom:link href="https://rpanev.pro/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Sat, 04 Jun 2022 19:58:27 +0000</pubDate>
    <lastBuildDate>Sat, 04 Jun 2022 19:58:27 +0000</lastBuildDate>
    <generator>Jekyll v3.9.2</generator>
    
      <item>
        <title>How to enable syntax highlighting for YAML files in Nano</title>
        <description>&lt;h1 id=&quot;description&quot;&gt;Description&lt;/h1&gt;
&lt;p&gt;Nano is a simple terminal-based text editor. Though not as powerful as Emacs or Vim, it is easy to learn and use. A lot of developers prefer this editor as it’s very simple to use and pretty useful when you only want to edit a single file quickly on your server.&lt;/p&gt;

&lt;p&gt;One of those files that you need to change often in this kind of editor are configuration file, like yaml files. Nano offers syntax highlighting for many file types, however not for yaml files. If you want to highlight this kind of files as well, you will need to follow an extra step.&lt;/p&gt;

&lt;p&gt;1 List available Nano Syntax Highlight Files&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;root@ansible]:[~]# &lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; /usr/share/nano/
asm.nanorc       changelog.nanorc  css.nanorc      elisp.nanorc    go.nanorc     html.nanorc        json.nanorc      man.nanorc   nanohelp.nanorc  objc.nanorc   perl.nanorc  postgresql.nanorc  ruby.nanorc  spec.nanorc     tex.nanorc
autoconf.nanorc  cmake.nanorc      debian.nanorc   fortran.nanorc  groff.nanorc  java.nanorc        lua.nanorc       mgp.nanorc   nanorc.nanorc    ocaml.nanorc  php.nanorc   pov.nanorc         rust.nanorc  tcl.nanorc      xml.nanorc
awk.nanorc       c.nanorc          default.nanorc  gentoo.nanorc   guile.nanorc  javascript.nanorc  makefile.nanorc  mutt.nanorc  nftables.nanorc  patch.nanorc  po.nanorc    python.nanorc      sh.nanorc    texinfo.nanorc  
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;root@ansible]:[~]#&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;2 Create YAML Nano Syntax Highlighting File
In order to provide syntax highlighting to your file, if the default file doesn’t exist, you need to create the syntax highlighting file for this language. This file is the yaml.nanorc file and you need to create it in the mentioned directory. Run nano to create the file:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;nano /usr/share/nano/yaml.nanorc&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;and paste the following content:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Supports `YAML` files&lt;/span&gt;
syntax &lt;span class=&quot;s2&quot;&gt;&quot;YAML&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ya?ml$&quot;&lt;/span&gt;
header &lt;span class=&quot;s2&quot;&gt;&quot;^(---|===)&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;%YAML&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;## Keys&lt;/span&gt;
color magenta &lt;span class=&quot;s2&quot;&gt;&quot;^&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\s&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;*[&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;A-Za-z0-9_-]+&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
color brightmagenta &lt;span class=&quot;s2&quot;&gt;&quot;^&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\s&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;*@[&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\$&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;A-Za-z0-9_-]+&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;## Values&lt;/span&gt;
color white &lt;span class=&quot;s2&quot;&gt;&quot;:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\s&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.+$&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;## Booleans&lt;/span&gt;
icolor brightcyan &lt;span class=&quot;s2&quot;&gt;&quot; (y|yes|n|no|true|false|on|off)$&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;## Numbers&lt;/span&gt;
color brightred &lt;span class=&quot;s2&quot;&gt;&quot; [[:digit:]]+(&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\.&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;[[:digit:]]+)?&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;## Arrays&lt;/span&gt;
color red &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\]&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\s&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;+[|&amp;gt;]&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;^&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\s&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;*- &quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;## Reserved&lt;/span&gt;
color green &lt;span class=&quot;s2&quot;&gt;&quot;(^| )!!(binary|bool|float|int|map|null|omap|seq|set|str) &quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;## Comments&lt;/span&gt;
color brightwhite &lt;span class=&quot;s2&quot;&gt;&quot;#.*$&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;## Errors&lt;/span&gt;
color ,red &lt;span class=&quot;s2&quot;&gt;&quot;:&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\w&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.+$&quot;&lt;/span&gt;
color ,red &lt;span class=&quot;s2&quot;&gt;&quot;:'.+$&quot;&lt;/span&gt;
color ,red &lt;span class=&quot;s2&quot;&gt;&quot;:&quot;&lt;/span&gt;.+&lt;span class=&quot;s2&quot;&gt;$&quot;
color ,red &quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\s&lt;/span&gt;+&lt;span class=&quot;s2&quot;&gt;$&quot;

## Non closed quote
color ,red &quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\&quot;][^['&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;$&quot;

## Closed quotes
color yellow &quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'\&quot;].*['&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;

## Equal sign
color brightgreen &quot;&lt;/span&gt;:&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt; |&lt;span class=&quot;nv&quot;&gt;$)&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/serialhex/nano-highlight&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;Visit the official repository of Nano Highlight &lt;/a&gt;, a spiffy collection of nano syntax highlighting files for more information and languages available for nano. This file will be automatically added into nano and will highlight yaml files. Save changes and proceed with the last step.&lt;/p&gt;

&lt;p&gt;3 Create Test Yaml File to see results
As final step, you need to test wheter the highlight works or not. Proceed to create a test file with nano and write some YAML on it, for example:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;hosts&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;updates&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;gather_facts&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;False&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;tasks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Check Dist Version&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;shell&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;cat /etc/os-release&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;register&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;response&lt;/span&gt;

    &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;debug&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;msg=''&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Save the file, edit it again and you will now see the YAML code highlighted.&lt;/p&gt;
</description>
        <pubDate>Fri, 14 Feb 2020 14:00:43 +0000</pubDate>
        <link>https://rpanev.pro/linux/ansible/2020/02/14/How-to-enable-syntax-highlighting-for-YAML-files-in-Nano.html</link>
        <guid isPermaLink="true">https://rpanev.pro/linux/ansible/2020/02/14/How-to-enable-syntax-highlighting-for-YAML-files-in-Nano.html</guid>
        
        <category>Linux</category>
        
        <category>ansible</category>
        
        
        <category>linux</category>
        
        <category>ansible</category>
        
      </item>
    
      <item>
        <title>Watch your Ansible deployments in Grafana!</title>
        <description>&lt;h1 id=&quot;description&quot;&gt;Description&lt;/h1&gt;
&lt;p&gt;От интерес търсих начин как да мониторирам използването на ansible, и попаднах на &lt;a href=&quot;https://docs.ansible.com/ansible/latest/plugins/callback/grafana_annotations.html&quot;&gt;това&lt;/a&gt; поразрових се и намерих страхотно поне за мен решемние.&lt;/p&gt;

&lt;p&gt;Създаваме директория с име “callback_plugins” за предпочитане в самата директория на ansible скриптовете&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt; &lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &amp;lt;your_playbook_dir&amp;gt;
 &lt;span class=&quot;nb&quot;&gt;mkdir &lt;/span&gt;callback_plugins&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;И изтегляме този &lt;a href=&quot;https://raw.githubusercontent.com/ansible-collections/grafana/master/plugins/callback/grafana_annotations.py&quot;&gt;плъгин&lt;/a&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /callback_plugins
wget https://raw.githubusercontent.com/ansible-collections/grafana/master/plugins/callback/grafana_annotations.py&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;разрешаваме на ansible да изпозлва този плъгин чрез &lt;a href=&quot;https://docs.ansible.com/ansible/devel/config.html&quot;&gt;ansible.cfg&lt;/a&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;...]
callback_whitelist &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; grafana_annotations&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;След като конфигурацията е готова ще трябва да зададем няколко параметъра за връзка&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GRAFANA_SERVER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;lt;your_grafana_server_address&amp;gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GRAFANA_PORT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;lt;your_grafana_server_port&amp;gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GRAFANA_SECURE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0                           &lt;span class=&quot;c&quot;&gt;# 0 for HTTP, 1 for HTTPS&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GRAFANA_API_TOKEN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;lt;your_grafana_api_token&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;За да си генерираме тоукън трябва да изпълним няколко стъпки:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;curl &lt;span class=&quot;nt&quot;&gt;-XPOST&lt;/span&gt; &amp;lt;your_grafana_server_address&amp;gt;:&amp;lt;your_grafana_server_port&amp;gt;/api/auth/keys &lt;span class=&quot;nt&quot;&gt;--user&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;admin:admin --data '{&quot;&lt;/span&gt;name&lt;span class=&quot;s2&quot;&gt;&quot;: &quot;&lt;/span&gt;ansible-callback&lt;span class=&quot;s2&quot;&gt;&quot;, &quot;&lt;/span&gt;role&lt;span class=&quot;s2&quot;&gt;&quot;: &quot;&lt;/span&gt;Editor&lt;span class=&quot;s2&quot;&gt;&quot;}' -H &quot;&lt;/span&gt;Content-Type: application/json&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Може да заложите конфигурацията директно в ansible.cfg файла:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;grafana_url &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&amp;lt;your_grafana_server_address&amp;gt;:&amp;lt;your_grafana_server_port&amp;gt;/api/annotations&quot;&lt;/span&gt;
validate_grafana_certs &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 1
http_agent &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Ansible (grafana_annotations callback)'&lt;/span&gt;
grafana_user &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &amp;lt;grafana user&amp;gt;
grafana_password &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &amp;lt;paasword&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Създаваме си нов панел в графан (Create a dashboard), от настройките избираме подменюто “annotations”&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/rpanev/rpanev.github.io/master/static/img/_posts/annotations.jpg&quot; alt=&quot;Watch your Ansible deployments in Grafana!&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Аз лично съм си направим таг за всеки ansible-playbook в разлизен цвят за да си ги следя по-лесно визуално&lt;/p&gt;
</description>
        <pubDate>Fri, 14 Feb 2020 14:00:43 +0000</pubDate>
        <link>https://rpanev.pro/linux/monitoring/ansible/2020/02/14/Watch-your-Ansible-deployments-in-Grafana.html</link>
        <guid isPermaLink="true">https://rpanev.pro/linux/monitoring/ansible/2020/02/14/Watch-your-Ansible-deployments-in-Grafana.html</guid>
        
        <category>Linux</category>
        
        <category>monitoring</category>
        
        <category>ansible</category>
        
        
        <category>linux</category>
        
        <category>monitoring</category>
        
        <category>ansible</category>
        
      </item>
    
      <item>
        <title>Enable PSK Encryption for Zabbix Agent on Linux</title>
        <description>&lt;h1 id=&quot;description&quot;&gt;Description&lt;/h1&gt;
&lt;p&gt;By default, agent communication is done in clear text.
For encryption we have an option to use PSK-based encryption.
PSK means pre shared key.
The PSK option consists of two important values, the PSK identity and the PSK Secret.
The secret should be minimum a 128-bit (16-byte PSK, entered as 32 hexadecimal digits) up to 2048-bit (256-byte PSK, entered as 512 hexadecimal digits)&lt;/p&gt;

&lt;p&gt;You can generate a 256 bit PSK secret with openssl using the command:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;openssl rand &lt;span class=&quot;nt&quot;&gt;-hex&lt;/span&gt; 32&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;I will save it directly to the zabbix directory&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /etc/zabbix&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;I then run,&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;openssl rand &lt;span class=&quot;nt&quot;&gt;-hex&lt;/span&gt; 32 &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; secret.psk&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;I also make sure that only the Zabbix user can read the file.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;chown &lt;/span&gt;zabbix:zabbix secret.psk &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;chmod &lt;/span&gt;640 secret.psk&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;I then edit the Zabbix agent configuration file.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;nano /etc/zabbix/zabbix_agentd.conf&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;and change the options near the bottom,&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;TLSConnect&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;psk
&lt;span class=&quot;nv&quot;&gt;TLSAccept&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;psk
&lt;span class=&quot;nv&quot;&gt;TLSPSKFile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;secret.psk
&lt;span class=&quot;nv&quot;&gt;TLSPSKIdentity&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=[&lt;/span&gt;my secret pass]&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;aside class=&quot;warning&quot;&gt;
The TLSPSKIdentity value you decide will not be encrypted on transport, so don't use anything sensitive.
&lt;/aside&gt;

&lt;p&gt;I then restart the agent&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;service zabbix-agent restart&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h1 id=&quot;the-configuration-of-the-zabbix-server-is-as-follows&quot;&gt;The configuration of the zabbix server is as follows&lt;/h1&gt;

&lt;p&gt;Configuration &amp;gt; Host &amp;gt; we choose the host for which to put psk and we click on it &amp;gt; Encryption &amp;gt; I select the :&lt;/p&gt;

&lt;p&gt;‘Connections to host’ = PSK&lt;/p&gt;

&lt;p&gt;‘Connections from host’ = PSK&lt;/p&gt;

&lt;p&gt;‘PSK Identity’ = [what ever you used in the Zabbix agent config]&lt;/p&gt;

&lt;p&gt;‘PSK’ = [the long hex string generated from the OpenSSL command above]&lt;/p&gt;

&lt;p&gt;After a minute or two, the Zabbix Server and Agent will successfully communicate using PSK encryption.&lt;/p&gt;
</description>
        <pubDate>Wed, 04 Dec 2019 12:37:43 +0000</pubDate>
        <link>https://rpanev.pro/linux/monitoring/2019/12/04/Enable-PSK-Encryption-for-Zabbix-Agent-on-Linux.html</link>
        <guid isPermaLink="true">https://rpanev.pro/linux/monitoring/2019/12/04/Enable-PSK-Encryption-for-Zabbix-Agent-on-Linux.html</guid>
        
        <category>Linux</category>
        
        <category>monitoring</category>
        
        
        <category>linux</category>
        
        <category>monitoring</category>
        
      </item>
    
      <item>
        <title>Инсталация на Command-line interface for Hetzner Cloud</title>
        <description>&lt;h1 id=&quot;създаваме-api-token&quot;&gt;Създаваме API Token&lt;/h1&gt;

&lt;ol&gt;
  &lt;li&gt;За целта е необходимо да посетим следният сайт &lt;a href=&quot;https://console.hetzner.cloud&quot;&gt;Hetzner&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Създаваме/Избираме проект&lt;/li&gt;
  &lt;li&gt;Отиваме на Access &amp;gt; API tokens и големият червен бутон &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;GENERATE API TOKEN&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Слагаме описание и копираме тоукъна&lt;/li&gt;
&lt;/ol&gt;

&lt;h1 id=&quot;инсталация-на-hcloud-command-line-interface-for-hetzner-cloud&quot;&gt;Инсталация на hcloud: Command-line interface for Hetzner Cloud&lt;/h1&gt;

&lt;p&gt;1) За MacOS и Linux или разбира може да свалим сорса от &lt;a href=&quot;https://github.com/hetznercloud/cli/releases/tag/v1.13.0&quot;&gt;Github.&lt;/a&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;brew &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;hcloud
Updating Homebrew...
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; Auto-updated Homebrew!
Updated 2 taps &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;homebrew/core and homebrew/cask&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; New Formulae
manticoresearch
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; Updated Formulae
git ✔          ack            cmake          dcmtk          deark          gmt            harfbuzz       hydra          jsvc           libssh         offlineimap    php-cs-fixer   qt             siril          sourcedocs     tile38         ucloud         yafc

&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; Downloading https://homebrew.bintray.com/bottles/hcloud-1.13.0.catalina.bottle.tar.gz
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; Downloading from https://akamai.bintray.com/45/45162c76dbf09c5ccf2d8be86382b5c1c81d90740b1b42b3d4ef4e0cb8a421d1?__gda__&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;exp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1572869911~hmac&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;cc20d712b07ed3f460a1b4e86aad1a3fda98358bb3f48b90b665f1f4617a1a14&amp;amp;response-content-disposition&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;attachment%3Bfilename%3D%22hcloud-
&lt;span class=&quot;c&quot;&gt;######################################################################## 100.0%&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; Pouring hcloud-1.13.0.catalina.bottle.tar.gz
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
&lt;span class=&quot;o&quot;&gt;==&amp;gt;&lt;/span&gt; Summary
🍺  /usr/local/Cellar/hcloud/1.13.0: 8 files, 9.4MB&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;може да проверим версията&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;hcloud version
hcloud v1.13.0&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;HELP командата&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;hcloud context
Usage:
  hcloud context &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;FLAGS]
  hcloud context &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;command&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

Available Commands:
  active      Show active context
  create      Create a new context
  delete      Delete a context
  list        List contexts
  use         Use a context&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;създаме context и въвеждаме тоукъна&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;hcloud context create r.panev
Token:    &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;TOKEN&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
Context r.panev created and activated&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h1 id=&quot;създвана-на-клауд-сървър&quot;&gt;Създвана на клауд сървър&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;Проверяваме кой от предоставяните сървъри ще ни трябва&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;hcloud server-type list
ID   NAME        CORES   MEMORY     DISK     STORAGE TYPE
1    cx11        1       2.0 GB     20 GB    &lt;span class=&quot;nb&quot;&gt;local
&lt;/span&gt;2    cx11-ceph   1       2.0 GB     20 GB    network
3    cx21        2       4.0 GB     40 GB    &lt;span class=&quot;nb&quot;&gt;local
&lt;/span&gt;4    cx21-ceph   2       4.0 GB     40 GB    network
5    cx31        2       8.0 GB     80 GB    &lt;span class=&quot;nb&quot;&gt;local
&lt;/span&gt;6    cx31-ceph   2       8.0 GB     80 GB    network
7    cx41        4       16.0 GB    160 GB   &lt;span class=&quot;nb&quot;&gt;local
&lt;/span&gt;8    cx41-ceph   4       16.0 GB    160 GB   network
9    cx51        8       32.0 GB    240 GB   &lt;span class=&quot;nb&quot;&gt;local
&lt;/span&gt;10   cx51-ceph   8       32.0 GB    240 GB   network
11   ccx11       2       8.0 GB     80 GB    &lt;span class=&quot;nb&quot;&gt;local
&lt;/span&gt;12   ccx21       4       16.0 GB    160 GB   &lt;span class=&quot;nb&quot;&gt;local
&lt;/span&gt;13   ccx31       8       32.0 GB    240 GB   &lt;span class=&quot;nb&quot;&gt;local
&lt;/span&gt;14   ccx41       16      64.0 GB    360 GB   &lt;span class=&quot;nb&quot;&gt;local
&lt;/span&gt;15   ccx51       32      128.0 GB   600 GB   &lt;span class=&quot;nb&quot;&gt;local&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Вдигаме сървъра&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;hcloud server create &lt;span class=&quot;nt&quot;&gt;--image&lt;/span&gt; centos-8 &lt;span class=&quot;nt&quot;&gt;--type&lt;/span&gt; cx11 &lt;span class=&quot;nt&quot;&gt;--name&lt;/span&gt; panev-hcloud
   2s &lt;span class=&quot;o&quot;&gt;[====================================================================]&lt;/span&gt; 100%
Waiting &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;server 3578313 to have started... &lt;span class=&quot;k&quot;&gt;done
&lt;/span&gt;Server 3578313 created
IPv4: 78.47.127.86
Root password: AUkgv44dmqaFAX7K4Xbr&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;И вече си имаме сървърче :)&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;hcloud server list
ID        NAME                 STATUS    IPV4           IPV6                     DATACENTER
3578313   panev-hcloud         running   78.47.127.86   2a01:4f8:c2c:cfb8::/64   nbg1-dc3&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</description>
        <pubDate>Mon, 04 Nov 2019 14:20:43 +0000</pubDate>
        <link>https://rpanev.pro/devops/2019/11/04/%D0%98%D0%BD%D1%81%D1%82%D0%B0%D0%BB%D0%B0%D1%86%D0%B8%D1%8F-%D0%BD%D0%B0-Command-line-interface-for-Hetzner-Cloud.html</link>
        <guid isPermaLink="true">https://rpanev.pro/devops/2019/11/04/%D0%98%D0%BD%D1%81%D1%82%D0%B0%D0%BB%D0%B0%D1%86%D0%B8%D1%8F-%D0%BD%D0%B0-Command-line-interface-for-Hetzner-Cloud.html</guid>
        
        <category>devops</category>
        
        
        <category>devops</category>
        
      </item>
    
      <item>
        <title>Как да използваме terraform за aws</title>
        <description>&lt;h1 id=&quot;инсталация-от-source&quot;&gt;Инсталация от source&lt;/h1&gt;

&lt;p&gt;1) Ъпдейт на репозиторито&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;yum update &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;2) Отваряме страницата на проекта &lt;a href=&quot;https://www.terraform.io/&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;Terraform&lt;/a&gt; и сваляме последната катуална версия&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;https://releases.hashicorp.com/terraform/0.12.10/terraform_0.12.10_linux_amd64.zip&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;3) Разахивираме приложението&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;unzip ./terraform_0.12.10_linux_amd64.zip &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; /usr/local/bin/&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;4) Един бърз тест:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;terraform &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt;
Terraform v0.12.10&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;5) Създаваме си файл aws-vps.tf&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nb&quot;&gt;touch &lt;/span&gt;aws-vps.tf&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;6) Попълваме нужната информация за вдигане на VPS, без много екстри&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-terraform&quot; data-lang=&quot;terraform&quot;&gt;&lt;span class=&quot;k&quot;&gt;provider&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;aws&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;region&lt;/span&gt;     &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;eu-central-1&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;access_key&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;accesskey&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;secret_key&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;secretkey&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;resource&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;aws_instance&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;panev_test_terraform&quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;ami&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ami-9a183671&quot;&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;instance_type&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;t2.micro&quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;7) След това трябва да инициализираме Terraform:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;terraform init

Initializing provider plugins...
- Checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;available provider plugins...
- Downloading plugin &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;provider &lt;span class=&quot;s2&quot;&gt;&quot;aws&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;hashicorp/aws&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; 2.32.0...

The following providers &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;not have any version constraints &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;configuration,
so the latest version was installed.

To prevent automatic upgrades to new major versions that may contain breaking
changes, it is recommended to add version &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;...&quot;&lt;/span&gt; constraints to the
corresponding provider blocks &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;configuration, with the constraint strings
suggested below.

&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; provider.aws: version &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;~&amp;gt; 2.32&quot;&lt;/span&gt;


Warning: Skipping backend initialization pending configuration upgrade

The root module configuration contains errors that may be fixed by running the
configuration upgrade tool, so Terraform is skipping backend initialization.
See below &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;more information.


Terraform has initialized, but configuration upgrades may be needed.

Terraform found syntax errors &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;the configuration that prevented full
initialization. If you&lt;span class=&quot;s1&quot;&gt;'ve recently upgraded to Terraform v0.12, this may be
because your configuration uses syntax constructs that are no longer valid,
and so must be updated before full initialization is possible.

Terraform has installed the required providers to support the configuration
upgrade process. To begin upgrading your configuration, run the following:
    terraform 0.12upgrade

To see the full set of errors that led to this message, run:
    terraform validate&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;8) Валидираме нашият код&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;terraform validate&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;При грешка ще ни каже къде е проблема :&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;terraform validate

Error: Unsupported block &lt;span class=&quot;nb&quot;&gt;type

  &lt;/span&gt;on vps.tf line 1:
   1: &lt;span class=&quot;nb&quot;&gt;cat &lt;/span&gt;aws-vps.tf

Blocks of &lt;span class=&quot;nb&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;cat&quot;&lt;/span&gt; are not expected here. Did you mean &lt;span class=&quot;s2&quot;&gt;&quot;data&quot;&lt;/span&gt;?


Error: Invalid block definition

  on aws-vps.tf line 1:
   1: &lt;span class=&quot;nb&quot;&gt;cat &lt;/span&gt;aws-vps.tf

Either a quoted string block label or an opening brace &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;{&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; is expected here.&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Когато всичко е както трябва :&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;terraform validate
Success! The configuration is valid.&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;9) Може да изпозлваме комнадата &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;terraform plan&lt;/code&gt; и така, ще направим симулация без да направим нищо в aws:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;terraform plan
Refreshing Terraform state &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-memory&lt;/span&gt; prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;or remote state storage.


&lt;span class=&quot;nt&quot;&gt;------------------------------------------------------------------------&lt;/span&gt;

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  &lt;span class=&quot;c&quot;&gt;# aws_instance.panev_test_terraform will be created&lt;/span&gt;
  + resource &lt;span class=&quot;s2&quot;&gt;&quot;aws_instance&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;panev_test_terraform&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      + ami                          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ami-9a183671&quot;&lt;/span&gt;
      + arn                          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + associate_public_ip_address  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + availability_zone            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + cpu_core_count               &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + cpu_threads_per_core         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + get_password_data            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt;
      + host_id                      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + &lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;                           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + instance_state               &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + instance_type                &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;t2.micro&quot;&lt;/span&gt;
      + ipv6_address_count           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + ipv6_addresses               &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + key_name                     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + network_interface_id         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + password_data                &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + placement_group              &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + primary_network_interface_id &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + private_dns                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + private_ip                   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + public_dns                   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + public_ip                    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + security_groups              &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + source_dest_check            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;
      + subnet_id                    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + tenancy                      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + volume_tags                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + vpc_security_group_ids       &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

      + ebs_block_device &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          + delete_on_termination &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + device_name           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + encrypted             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + iops                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + kms_key_id            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + snapshot_id           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + volume_id             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + volume_size           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + volume_type           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

      + ephemeral_block_device &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          + device_name  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + no_device    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + virtual_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

      + network_interface &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          + delete_on_termination &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + device_index          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + network_interface_id  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

      + root_block_device &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          + delete_on_termination &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + encrypted             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + iops                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + kms_key_id            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + volume_id             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + volume_size           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + volume_type           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

Plan: 1 to add, 0 to change, 0 to destroy.

&lt;span class=&quot;nt&quot;&gt;------------------------------------------------------------------------&lt;/span&gt;

Note: You didn&lt;span class=&quot;s1&quot;&gt;'t specify an &quot;-out&quot; parameter to save this plan, so Terraform
can'&lt;/span&gt;t guarantee that exactly these actions will be performed &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&quot;terraform apply&quot;&lt;/span&gt; is subsequently run.&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;10) След като се убедим в това което искаме изпълняваме &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;terraform apply&lt;/code&gt;  и потвърждаме на въпроса с &lt;em&gt;yes&lt;/em&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;terraform apply

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  &lt;span class=&quot;c&quot;&gt;# aws_instance.panev_test_terraform will be created&lt;/span&gt;
  + resource &lt;span class=&quot;s2&quot;&gt;&quot;aws_instance&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;panev_test_terraform&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      + ami                          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ami-9a183671&quot;&lt;/span&gt;
      + arn                          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + associate_public_ip_address  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + availability_zone            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + cpu_core_count               &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + cpu_threads_per_core         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + get_password_data            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt;
      + host_id                      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + &lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;                           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + instance_state               &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + instance_type                &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;t2.micro&quot;&lt;/span&gt;
      + ipv6_address_count           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + ipv6_addresses               &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + key_name                     &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + network_interface_id         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + password_data                &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + placement_group              &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + primary_network_interface_id &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + private_dns                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + private_ip                   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + public_dns                   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + public_ip                    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + security_groups              &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + source_dest_check            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;
      + subnet_id                    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + tenancy                      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + volume_tags                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
      + vpc_security_group_ids       &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

      + ebs_block_device &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          + delete_on_termination &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + device_name           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + encrypted             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + iops                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + kms_key_id            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + snapshot_id           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + volume_id             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + volume_size           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + volume_type           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

      + ephemeral_block_device &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          + device_name  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + no_device    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + virtual_name &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

      + network_interface &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          + delete_on_termination &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + device_index          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + network_interface_id  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

      + root_block_device &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          + delete_on_termination &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + encrypted             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + iops                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + kms_key_id            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + volume_id             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + volume_size           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
          + volume_type           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;known after apply&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only &lt;span class=&quot;s1&quot;&gt;'yes'&lt;/span&gt; will be accepted to approve.

  Enter a value: &lt;span class=&quot;nb&quot;&gt;yes

&lt;/span&gt;aws_instance.panev_test_terraform: Creating...
aws_instance.panev_test_terraform: Still creating... &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;10s elapsed]
aws_instance.panev_test_terraform: Still creating... &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;20s elapsed]
aws_instance.panev_test_terraform: Still creating... &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;30s elapsed]
aws_instance.panev_test_terraform: Creation &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;after 34s &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;i-0aae21339de0060c2]

Apply &lt;span class=&quot;nb&quot;&gt;complete&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt; Resources: 1 added, 0 changed, 0 destroyed.&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;11) За да премахнем инстанцията пишем &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;terraform destroy&lt;/code&gt; и потвърждаме на въпроса с &lt;em&gt;yes&lt;/em&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;terraform destroy
aws_instance.panev_test_terraform: Refreshing state... &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;i-084ff7c42ceb73240]

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  &lt;span class=&quot;c&quot;&gt;# aws_instance.panev_test_terraform will be destroyed&lt;/span&gt;
  - resource &lt;span class=&quot;s2&quot;&gt;&quot;aws_instance&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;panev_test_terraform&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
      - ami                          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ami-9a183671&quot;&lt;/span&gt; -&amp;gt; null
      - arn                          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;arn:aws:ec2:eu-central-1:918488250450:instance/i-084ff7c42ceb73240&quot;&lt;/span&gt; -&amp;gt; null
      - associate_public_ip_address  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt; -&amp;gt; null
      - availability_zone            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;eu-central-1b&quot;&lt;/span&gt; -&amp;gt; null
      - cpu_core_count               &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 1 -&amp;gt; null
      - cpu_threads_per_core         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 1 -&amp;gt; null
      - disable_api_termination      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt; -&amp;gt; null
      - ebs_optimized                &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt; -&amp;gt; null
      - get_password_data            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt; -&amp;gt; null
      - &lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;                           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;i-084ff7c42ceb73240&quot;&lt;/span&gt; -&amp;gt; null
      - instance_state               &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;running&quot;&lt;/span&gt; -&amp;gt; null
      - instance_type                &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;t2.micro&quot;&lt;/span&gt; -&amp;gt; null
      - ipv6_address_count           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 0 -&amp;gt; null
      - ipv6_addresses               &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt; -&amp;gt; null
      - monitoring                   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt; -&amp;gt; null
      - primary_network_interface_id &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;eni-0ae9762298a6f00bc&quot;&lt;/span&gt; -&amp;gt; null
      - private_dns                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ip-172-31-36-173.eu-central-1.compute.internal&quot;&lt;/span&gt; -&amp;gt; null
      - private_ip                   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;172.31.36.173&quot;&lt;/span&gt; -&amp;gt; null
      - public_dns                   &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;ec2-18-185-69-50.eu-central-1.compute.amazonaws.com&quot;&lt;/span&gt; -&amp;gt; null
      - public_ip                    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;18.185.69.50&quot;&lt;/span&gt; -&amp;gt; null
      - security_groups              &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;
          - &lt;span class=&quot;s2&quot;&gt;&quot;default&quot;&lt;/span&gt;,
        &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; -&amp;gt; null
      - source_dest_check            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt; -&amp;gt; null
      - subnet_id                    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;subnet-7a391307&quot;&lt;/span&gt; -&amp;gt; null
      - tags                         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; -&amp;gt; null
      - tenancy                      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;default&quot;&lt;/span&gt; -&amp;gt; null
      - volume_tags                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt; -&amp;gt; null
      - vpc_security_group_ids       &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;
          - &lt;span class=&quot;s2&quot;&gt;&quot;sg-57d0ac36&quot;&lt;/span&gt;,
        &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; -&amp;gt; null

      - credit_specification &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          - cpu_credits &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;standard&quot;&lt;/span&gt; -&amp;gt; null
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

      - root_block_device &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
          - delete_on_termination &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt; -&amp;gt; null
          - encrypted             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;false&lt;/span&gt; -&amp;gt; null
          - iops                  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 100 -&amp;gt; null
          - volume_id             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;vol-0ac02fec6b74e9030&quot;&lt;/span&gt; -&amp;gt; null
          - volume_size           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 8 -&amp;gt; null
          - volume_type           &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;gp2&quot;&lt;/span&gt; -&amp;gt; null
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

Plan: 0 to add, 0 to change, 1 to destroy.

Do you really want to destroy all resources?
  Terraform will destroy all your managed infrastructure, as shown above.
  There is no undo. Only &lt;span class=&quot;s1&quot;&gt;'yes'&lt;/span&gt; will be accepted to confirm.

  Enter a value: &lt;span class=&quot;nb&quot;&gt;yes

&lt;/span&gt;aws_instance.panev_test: Destroying... &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;i-084ff7c42ceb73240]
aws_instance.panev_test: Still destroying... &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;i-084ff7c42ceb73240, 10s elapsed]
aws_instance.panev_test: Still destroying... &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;i-084ff7c42ceb73240, 20s elapsed]
aws_instance.panev_test: Still destroying... &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;i-084ff7c42ceb73240, 30s elapsed]
aws_instance.panev_test: Destruction &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;after 30s

Destroy &lt;span class=&quot;nb&quot;&gt;complete&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt; Resources: 1 destroyed.&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
</description>
        <pubDate>Wed, 16 Oct 2019 12:48:43 +0000</pubDate>
        <link>https://rpanev.pro/devops/linux/2019/10/16/how-to-use-terraform.html</link>
        <guid isPermaLink="true">https://rpanev.pro/devops/linux/2019/10/16/how-to-use-terraform.html</guid>
        
        <category>devops</category>
        
        
        <category>devops</category>
        
        <category>linux</category>
        
      </item>
    
      <item>
        <title>Как да инсталираме и конфигурираме Prometheus на Linux VM</title>
        <description>&lt;center&gt;
&lt;img src=&quot;https://raw.githubusercontent.com/rpanev/rpanev.github.io/master/static/img/_posts/Prometheus-Logo.jpg&quot; alt=&quot;Prometheus &quot; /&gt;
&lt;/center&gt;

&lt;h1 id=&quot;инсталация-от-source&quot;&gt;Инсталация от source&lt;/h1&gt;

&lt;ol&gt;
  &lt;li&gt;Ъпдейт на репозиторито&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;yum update &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Отваряме страницата на проекта &lt;a href=&quot;https://prometheus.io/download/&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;Prometheus&lt;/a&gt; и сваляме последната катуална версия&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Сваляме нужнитя ни пакет&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; /opt/
curl &lt;span class=&quot;nt&quot;&gt;-LO&lt;/span&gt; https://github.com/prometheus/prometheus/releases/download/v2.12.0/prometheus-2.12.0.linux-amd64.tar.gz
&lt;span class=&quot;nb&quot;&gt;tar&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-xvf&lt;/span&gt; prometheus-2.3.2.linux-amd64.tar.gz
&lt;span class=&quot;nb&quot;&gt;mv &lt;/span&gt;prometheus-2.3.2.linux-amd64 prometheus-files&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol&gt;
  &lt;li&gt;Създаваме потребител prometheus, нужните директории и техните права&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;useradd &lt;span class=&quot;nt&quot;&gt;--no-create-home&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--shell&lt;/span&gt; /bin/false prometheus
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; /etc/prometheus
&lt;span class=&quot;nb&quot;&gt;mkdir&lt;/span&gt; /var/lib/prometheus
&lt;span class=&quot;nb&quot;&gt;chown &lt;/span&gt;prometheus:prometheus /etc/prometheus
&lt;span class=&quot;nb&quot;&gt;chown &lt;/span&gt;prometheus:prometheus /var/lib/prometheus&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol&gt;
  &lt;li&gt;Копираме бинарните файлове от директория prometheus-files във /usr/bin/&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cp &lt;/span&gt;prometheus-files/prometheus /usr/local/bin/
&lt;span class=&quot;nb&quot;&gt;cp &lt;/span&gt;prometheus-files/promtool /usr/local/bin/
&lt;span class=&quot;nb&quot;&gt;chown &lt;/span&gt;prometheus:prometheus /usr/local/bin/prometheus
&lt;span class=&quot;nb&quot;&gt;chown &lt;/span&gt;prometheus:prometheus /usr/local/bin/promtool&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol&gt;
  &lt;li&gt;Преместваме директориите consoles и console_libraries в /etc/prometheus&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cp&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; prometheus-files/consoles /etc/prometheus
&lt;span class=&quot;nb&quot;&gt;cp&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; prometheus-files/console_libraries /etc/prometheus
&lt;span class=&quot;nb&quot;&gt;chown&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; prometheus:prometheus /etc/prometheus/consoles
&lt;span class=&quot;nb&quot;&gt;chown&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; prometheus:prometheus /etc/prometheus/console_libraries&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h1 id=&quot;конфигурация-на-prometheus&quot;&gt;Конфигурация на prometheus&lt;/h1&gt;

&lt;p&gt;Необходимата конфигурация се намира във файла /etc/prometheus/prometheus.yml.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Създаваме фйала prometheus.yml&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;touch&lt;/span&gt; /etc/prometheus/prometheus.yml&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol&gt;
  &lt;li&gt;Копирайте следните редове във вашият prometheus.yml файл.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yml&quot; data-lang=&quot;yml&quot;&gt;&lt;span class=&quot;na&quot;&gt;global&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;scrape_interval&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;10s&lt;/span&gt;
 
&lt;span class=&quot;na&quot;&gt;scrape_configs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;job_name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;prometheus'&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;scrape_interval&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;5s&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;static_configs&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;targets&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;localhost:9090'&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol&gt;
  &lt;li&gt;Оправяме правата на файла:&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;chown &lt;/span&gt;prometheus:prometheus /etc/prometheus/prometheus.yml&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h1 id=&quot;създаваме-prometheus-service-файл&quot;&gt;Създаваме Prometheus Service файл&lt;/h1&gt;

&lt;ol&gt;
  &lt;li&gt;Създаваме фйала /etc/systemd/system/prometheus.service&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;touch&lt;/span&gt; /etc/systemd/system/prometheus.service&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol&gt;
  &lt;li&gt;Копирайте следните редове във вашият prometheus.service файл.&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Unit]
&lt;span class=&quot;nv&quot;&gt;Description&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;Prometheus
&lt;span class=&quot;nv&quot;&gt;Wants&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;network-online.target
&lt;span class=&quot;nv&quot;&gt;After&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;network-online.target
 
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Service]
&lt;span class=&quot;nv&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;prometheus
&lt;span class=&quot;nv&quot;&gt;Group&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;prometheus
&lt;span class=&quot;nv&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;simple
&lt;span class=&quot;nv&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/local/bin/prometheus &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--config&lt;/span&gt;.file /etc/prometheus/prometheus.yml &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--storage&lt;/span&gt;.tsdb.path /var/lib/prometheus/ &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--web&lt;/span&gt;.console.templates&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/etc/prometheus/consoles &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;--web&lt;/span&gt;.console.libraries&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/etc/prometheus/console_libraries
 
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Install]
&lt;span class=&quot;nv&quot;&gt;WantedBy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;multi-user.target&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol&gt;
  &lt;li&gt;Презареждаме systemd service и стартираме prometheus&lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;systemctl daemon-reload
systemctl start prometheus&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h1 id=&quot;access-prometheus-web-ui&quot;&gt;Access Prometheus Web UI&lt;/h1&gt;

&lt;p&gt;Достъп до Web UI може да направите на вашият IP и порт 9090&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;http://prometheus-ip&amp;gt;:9090/graph&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
</description>
        <pubDate>Wed, 11 Sep 2019 18:57:43 +0000</pubDate>
        <link>https://rpanev.pro/centos/devops/linux/monitoring/prometheus/2019/09/11/%D0%9A%D0%B0%D0%BA-%D0%B4%D0%B0-%D0%B8%D0%BD%D1%81%D1%82%D0%B0%D0%BB%D0%B8%D1%80%D0%B0%D0%BC%D0%B5-%D0%B8-%D0%BA%D0%BE%D0%BD%D1%84%D0%B8%D0%B3%D1%83%D1%80%D0%B8%D1%80%D0%B0%D0%BC%D0%B5-Prometheus-%D0%BD%D0%B0-Linux-VM.html</link>
        <guid isPermaLink="true">https://rpanev.pro/centos/devops/linux/monitoring/prometheus/2019/09/11/%D0%9A%D0%B0%D0%BA-%D0%B4%D0%B0-%D0%B8%D0%BD%D1%81%D1%82%D0%B0%D0%BB%D0%B8%D1%80%D0%B0%D0%BC%D0%B5-%D0%B8-%D0%BA%D0%BE%D0%BD%D1%84%D0%B8%D0%B3%D1%83%D1%80%D0%B8%D1%80%D0%B0%D0%BC%D0%B5-Prometheus-%D0%BD%D0%B0-Linux-VM.html</guid>
        
        <category>prometheus</category>
        
        <category>systemd</category>
        
        
        <category>centos</category>
        
        <category>devops</category>
        
        <category>linux</category>
        
        <category>Monitoring</category>
        
        <category>Prometheus</category>
        
      </item>
    
      <item>
        <title>Черен екран при събуждане на Mac</title>
        <description>&lt;p&gt;Наложи ми се да си преинсталирам лаптопа macbook pro но лаптопа влезе в режим sleep и не можех да го събудя. При натискна не power бутона видимо не се случваше нищо, просветката не светеше, капслока също, няма звук, няма картина…демек тухла за 3000 лева 🙂 След като го оставих малко на страни и да си събера мислите забелязах, че лаптопа работи. ГРЕЕ. Ураааа има живот все още в него&lt;/p&gt;

&lt;p&gt;Не се паникьосвайте!&lt;/p&gt;

&lt;p&gt;В случай, че изпаднете в подобно състояние изпробвайте следните стъпи, при мене имаше моментален ефект. Трябва да се рестартира управлението на захранването и &lt;a href=&quot;https://support.apple.com/en-us/HT204063&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;NVRAM&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;ко имате някакви проблеми със своя MacBook, MacBook Air, MacBook Pro или с операционната системата или устройството, свързано към Mac, един от начините за решаване на проблема е да се изчисти паметта на компютъра на данни (NVRAM и PRAM), която се съхранява на твърдия диск. Тези данни не могат да бъдат изтрити, когато изключите своя компютър.&lt;/p&gt;

&lt;p&gt;**&lt;br /&gt;
Дефиниции:**&lt;/p&gt;

&lt;p&gt;NVRAM – Енергонезависима памет с произволен достъп, енергонезависима памет, която е в близост до RAM, но продължава да съществува дори и без външен източник на захранване.&lt;/p&gt;

&lt;p&gt;PRAM – Параметър оперативна памет която съдържа най-вече обаче данни на операционната система. Наред с другите неща,се съхраняват данни за MacOS, шрифта който се използва, алармени настройки, дисков кеш, и т.н.&lt;/p&gt;

&lt;p&gt;SMC – Контролер система за управление, чип на дънната платка на вашияt Mac или MacBook, Отговаря за управлението на захранването, функциите на хардуера, включително USB устройства и Bluetooth.&lt;/p&gt;

&lt;p&gt;**&lt;br /&gt;
Тази памет NVRAM и PRAM съхранява тези настройки, като:**&lt;/p&gt;

&lt;p&gt;данни за диска;&lt;br /&gt;
виртуална памет;&lt;br /&gt;
настройки на монитора и високоговорителите;&lt;br /&gt;
системни шрифтове;&lt;br /&gt;
други настройки.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;За да нулирате NVRAM и PRAM:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Стъпка 1 – Изключете своя Mac;&lt;br /&gt;
Стъпка 2 – Включете своя Mac;&lt;/p&gt;

&lt;p&gt;Стъпка 3 – След като чуете стартовия сигнал, задръжте натиснат клавиша ⌥Option (Alt) + ⌘Cmd + P + R и го задръжте;&lt;/p&gt;

&lt;p&gt;Стъпка 4 – Компютърът ще се рестартира и отново ще чуете стартовия сигнал, след което можете да освободите клавишите.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Нулиране на настройките на SMC контролера&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ако забележите проблеми, които са свързани със:&lt;/p&gt;

&lt;p&gt;реакция при натискане на бутона за захранване;&lt;br /&gt;
реакция при отваряне и затваряне на капака на дисплея на Mac;&lt;br /&gt;
управление на батерийни ресурси;&lt;br /&gt;
температурен контрол;&lt;br /&gt;
сензор за внезапно движение (SMS)&lt;br /&gt;
сензор за околна светлина;&lt;br /&gt;
подсветката на клавиатурата;&lt;br /&gt;
контрол на индикатора за състояние;&lt;br /&gt;
индикатори за състояние на батерията;&lt;/p&gt;

&lt;p&gt;Избиране на външен (вместо вътрешен) видео източник за отделните дисплеи на iMac, или други проблеми, то тогава е необходимо да нулирате SMC параметрите на вашият MacBook, MacBook Air, MacBook Pro.&lt;/p&gt;

&lt;p&gt;За да нулирате SMC параметрите:&lt;/p&gt;

&lt;p&gt;Стъпка 1 – Изключете компютъра и го свържете към мрежата чрез захранващия адаптер MagSafe или USB-C&lt;/p&gt;

&lt;p&gt;Стъпка 2 – Задръжте натиснатите клавиши ⇧Shift + ^ Ctrl + ⌥Option (Alt) и, без да ги пускате, натиснете бутона за включване&lt;/p&gt;

&lt;p&gt;Стъпка 3 – Освободете клавишите и отново натиснете бутона за включване&lt;/p&gt;

&lt;p&gt;«center&amp;gt;
&lt;img src=&quot;https://raw.githubusercontent.com/rpanev/rpanev.github.io/master/static/img/_posts/nvram.jpg&quot; alt=&quot;Черен екран при събуждане на Mac&quot; /&gt;
&amp;lt;/center&amp;gt;&lt;/p&gt;
</description>
        <pubDate>Mon, 19 Aug 2019 09:30:43 +0000</pubDate>
        <link>https://rpanev.pro/macos/2019/08/19/%D0%A7%D0%B5%D1%80%D0%B5%D0%BD-%D0%B5%D0%BA%D1%80%D0%B0%D0%BD-%D0%BF%D1%80%D0%B8-%D1%81%D1%8A%D0%B1%D1%83%D0%B6%D0%B4%D0%B0%D0%BD%D0%B5-%D0%BD%D0%B0-Mac.html</link>
        <guid isPermaLink="true">https://rpanev.pro/macos/2019/08/19/%D0%A7%D0%B5%D1%80%D0%B5%D0%BD-%D0%B5%D0%BA%D1%80%D0%B0%D0%BD-%D0%BF%D1%80%D0%B8-%D1%81%D1%8A%D0%B1%D1%83%D0%B6%D0%B4%D0%B0%D0%BD%D0%B5-%D0%BD%D0%B0-Mac.html</guid>
        
        <category>MacOS</category>
        
        <category>NVRAM</category>
        
        <category>sleep</category>
        
        
        <category>macos</category>
        
      </item>
    
      <item>
        <title>Upload ssh key through ansible</title>
        <description>&lt;p&gt;Upload ssh key through ansible&lt;br /&gt;
Create a file named ssh-key-setup.yml in directory name /etc/ansible/playbooks.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-yaml&quot; data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;s&quot;&gt;---&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
  &lt;span class=&quot;s&quot;&gt;- hosts&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;all&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;become&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;yes&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;#To start  ansible-playbook ssh-key-setup.yml -u panev --ask-pass&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;

    &lt;span class=&quot;na&quot;&gt;tasks&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Creates destination directory&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;state=directory mode=0700 dest=/root/.ssh/ &lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;#file: state=directory mode=0700 owner=panev group=panev dest=/home/panev/.ssh/ #FOR USERS
&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Pushes user's rsa key to root's users box (it's ok if this TASK fails)&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;copy&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;src=~/.ssh/id_rsa.pub dest=/root/.ssh/authorized_keys owner=root mode=0600&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;#copy: src=~/.ssh/id_rsa.pub dest=/home/panev/.ssh/authorized_keys owner=panev group=panev mode=0600 #FOR USERS
&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
 &lt;span class=&quot;c1&quot;&gt;#     - name: Set authorized key for user X copying it from current user
&lt;/span&gt;
 &lt;span class=&quot;c1&quot;&gt;#       authorized_key:
&lt;/span&gt;
 &lt;span class=&quot;c1&quot;&gt;#         user: panev
&lt;/span&gt;
 &lt;span class=&quot;c1&quot;&gt;#         state: present
&lt;/span&gt;
 &lt;span class=&quot;c1&quot;&gt;#         key: &quot;&quot;
&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Change SSH port&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;lineinfile&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;dest&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/etc/ssh/sshd_config&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;regexp&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;^Port&quot;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;line&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;Port&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;2222&quot;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;present&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;

          &lt;span class=&quot;c1&quot;&gt;#Remove root login
&lt;/span&gt;
 &lt;span class=&quot;c1&quot;&gt;#     - name: Remove root SSH access
&lt;/span&gt;
 &lt;span class=&quot;c1&quot;&gt;#       lineinfile:
&lt;/span&gt;
 &lt;span class=&quot;c1&quot;&gt;#        dest: /etc/ssh/sshd_config
&lt;/span&gt;
 &lt;span class=&quot;c1&quot;&gt;#        regexp: &quot;^PermitRootLogin&quot;
&lt;/span&gt;
 &lt;span class=&quot;c1&quot;&gt;#        line: &quot;PermitRootLogin no&quot;
&lt;/span&gt;
 &lt;span class=&quot;c1&quot;&gt;#        state: present
&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Remove password SSH access&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;lineinfile&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;dest&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/etc/ssh/sshd_config&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;regexp&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;^PasswordAuthentication&quot;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;line&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;PasswordAuthentication&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;no&quot;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
          &lt;span class=&quot;na&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;present&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;

      &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;restart ssh&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;
&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;name=ssh state=restarted&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;To start ansible-playbook ssh-key-setup.yml -u root –ask-pass&lt;/p&gt;

&lt;center&gt;
&lt;img src=&quot;https://raw.githubusercontent.com/rpanev/rpanev.github.io/master/static/img/_posts/ansible-out-put.png&quot; alt=&quot;Upload ssh key through ansible &quot; /&gt;
&lt;/center&gt;
</description>
        <pubDate>Tue, 23 Jul 2019 11:15:41 +0000</pubDate>
        <link>https://rpanev.pro/ansible/devops/2019/07/23/upload-ssh-key-through-ansible.html</link>
        <guid isPermaLink="true">https://rpanev.pro/ansible/devops/2019/07/23/upload-ssh-key-through-ansible.html</guid>
        
        
        <category>ansible</category>
        
        <category>devops</category>
        
      </item>
    
      <item>
        <title>Инсталация на AWX на CentOS 7</title>
        <description>&lt;center&gt;
&lt;img src=&quot;https://raw.githubusercontent.com/rpanev/rpanev.github.io/master/static/img/_posts/awx.jpg&quot; alt=&quot;AWX &quot; /&gt;
&lt;/center&gt;

&lt;p&gt;&lt;br /&gt;
AWX е безплатна алтернатива на &lt;a href=&quot;https://access.redhat.com/products/ansible-tower-red-hat&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;Red Hat Ansible Tower&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Следвайте стъпките по-долу за инсталация върху CentOS 7 минимална инсталация&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Insall EPEL repository&lt;/span&gt;
yum &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;epel-release

&lt;span class=&quot;c&quot;&gt;# Спиране на защитната стена (firewall) и SELinux&lt;/span&gt;
systemctl disable firewalld
systemctl stop firewalld
&lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'s/SELINUX=enforcing/SELINUX=disabled/g'&lt;/span&gt; /etc/selinux/config
setenforce 0
reboot

&lt;span class=&quot;c&quot;&gt;# Инсталиране на нужните ни пакети&lt;/span&gt;
yum &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;git gettext ansible docker nodejs npm gcc-c++ bzip2
yum &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;python-docker-py

&lt;span class=&quot;c&quot;&gt;#  Start and enable docker service&lt;/span&gt;
systemctl start docker
systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;docker

&lt;span class=&quot;c&quot;&gt;# Клониране на хранилището и инсталацията му (ще отнеме около 20 минути)&lt;/span&gt;
git clone https://github.com/ansible/awx.git
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;awx/installer/
ansible-playbook &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; inventory install.yml

&lt;span class=&quot;c&quot;&gt;# Monitor migrations status (it will take about 10 minutes)&lt;/span&gt;
docker logs &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; awx_task&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Вече имате достъп до уеб сървъра на AWX http://IP. Потребителското име по подразбиране на администратора е admin, а паролата е password.&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/ZatqBgn_Wic&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;Повече за проекта може да намерите на следният &lt;a href=&quot;https://www.ansible.com/products/awx-project/faq&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;линк.&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Sat, 15 Jun 2019 17:19:56 +0000</pubDate>
        <link>https://rpanev.pro/ansible/devops/docker/2019/06/15/%D0%98%D0%BD%D1%81%D1%82%D0%B0%D0%BB%D0%B0%D1%86%D0%B8%D1%8F-%D0%BD%D0%B0-AWX-%D0%BD%D0%B0-CentOS-7.html</link>
        <guid isPermaLink="true">https://rpanev.pro/ansible/devops/docker/2019/06/15/%D0%98%D0%BD%D1%81%D1%82%D0%B0%D0%BB%D0%B0%D1%86%D0%B8%D1%8F-%D0%BD%D0%B0-AWX-%D0%BD%D0%B0-CentOS-7.html</guid>
        
        <category>ansible</category>
        
        <category>automation</category>
        
        <category>AWX</category>
        
        <category>docker</category>
        
        <category>nodejs</category>
        
        <category>python</category>
        
        
        <category>ansible</category>
        
        <category>devops</category>
        
        <category>docker</category>
        
      </item>
    
      <item>
        <title>Install Redis and Redis PHP on cPanel</title>
        <description>&lt;p&gt;Install EPLE repository&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;yum &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;epel-release
yum update
yum &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;redis
systemctl restart redis
systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;redis&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Install the &lt;a href=&quot;https://redis.io/&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;Redis&lt;/a&gt; PHP Extension EasyApache 4&lt;/p&gt;

&lt;p&gt;EasyApache 4 supports multiple versions of PHP so we need to install the Redis PHP extension on each PHP version. Run the following commands to install and enable the Redis PHP extension on each PHP version you have installed on your server:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;yes&lt;/span&gt; | /opt/cpanel/ea-php71/root/usr/bin/pecl &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;igbinary igbinary-devel redis 
/opt/cpanel/ea-php71/root/usr/bin/php &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;redis

&lt;span class=&quot;nb&quot;&gt;yes&lt;/span&gt; | /opt/cpanel/ea-php70/root/usr/bin/pecl &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;igbinary igbinary-devel redis 
/opt/cpanel/ea-php70/root/usr/bin/php &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;redis

&lt;span class=&quot;nb&quot;&gt;yes&lt;/span&gt; | /opt/cpanel/ea-php56/root/usr/bin/pecl &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;igbinary igbinary-devel redis 
/opt/cpanel/ea-php56/root/usr/bin/php &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;redis&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</description>
        <pubDate>Wed, 05 Jun 2019 05:13:17 +0000</pubDate>
        <link>https://rpanev.pro/centos/linux/2019/06/05/install-redis-and-redis-php-on-cpanel.html</link>
        <guid isPermaLink="true">https://rpanev.pro/centos/linux/2019/06/05/install-redis-and-redis-php-on-cpanel.html</guid>
        
        
        <category>centos</category>
        
        <category>linux</category>
        
      </item>
    
  </channel>
</rss>
