{"id":34990,"date":"2024-09-20T14:17:32","date_gmt":"2024-09-20T07:17:32","guid":{"rendered":"http:\/\/jupitek.maudemo.vip\/index.php\/2024\/09\/20\/use-and-modify-official-saltstack-formulas\/"},"modified":"2024-09-20T14:17:32","modified_gmt":"2024-09-20T07:17:32","slug":"use-and-modify-official-saltstack-formulas","status":"publish","type":"post","link":"https:\/\/jupitek.maudemo.vip\/index.php\/2024\/09\/20\/use-and-modify-official-saltstack-formulas\/","title":{"rendered":"S\u1eed d\u1ee5ng v\u00e0 ch\u1ec9nh s\u1eeda SaltStack Formulas ch\u00ednh th\u1ee9c"},"content":{"rendered":"<h2 id=\"salt-state-files\">T\u1eadp tin tr\u1ea1ng th\u00e1i Salt&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#salt-state-files\"><\/a><\/h2>\n<p>N\u1ec1n t\u1ea3ng SaltStack bao g\u1ed3m hai th\u00e0nh ph\u1ea7n ch\u00ednh: M\u1ed9t c\u00f4ng c\u1ee5 th\u1ef1c thi t\u1eeb xa x\u1eed l\u00fd giao ti\u1ebfp hai chi\u1ec1u cho b\u1ea5t k\u1ef3 n\u00fat n\u00e0o trong c\u01a1 s\u1edf h\u1ea1 t\u1ea7ng c\u1ee7a b\u1ea1n (master v\u00e0 minion) v\u00e0 m\u1ed9t h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd c\u1ea5u h\u00ecnh duy tr\u00ec t\u1ea5t c\u1ea3 c\u00e1c n\u00fat c\u01a1 s\u1edf h\u1ea1 t\u1ea7ng \u1edf tr\u1ea1ng th\u00e1i \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh. H\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd c\u1ea5u h\u00ecnh c\u1ee7a Salt \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 h\u1ec7 th\u1ed1ng&nbsp;<em>Salt State<\/em>&nbsp;. Tr\u1ea1ng th\u00e1i Salt \u0111\u01b0\u1ee3c khai b\u00e1o trong&nbsp;<em>t\u1ec7p Salt State<\/em>&nbsp;(SLS) b\u1eb1ng c\u00fa ph\u00e1p YAML v\u00e0 bi\u1ec3u di\u1ec5n th\u00f4ng tin m\u00e0 Salt c\u1ea7n \u0111\u1ec3 c\u1ea5u h\u00ecnh minion. C\u00f4ng th\u1ee9c Salt l\u00e0 t\u1eadp h\u1ee3p c\u00e1c t\u1ec7p SLS c\u00f3 li\u00ean quan s\u1ebd \u0111\u1ea1t \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh chung.<\/p>\n<p>Trang GitHub c\u1ee7a SaltStack ch\u1ee9a c\u00e1c c\u00f4ng th\u1ee9c Salt cho c\u00e1c c\u1ea5u h\u00ecnh th\u01b0\u1eddng d\u00f9ng, nh\u01b0 t\u1ea1o v\u00e0 qu\u1ea3n l\u00fd ch\u1ee9ng ch\u1ec9 SSL\/TLS, c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh Apache HTTP Server, c\u00e0i \u0111\u1eb7t v\u00e0 c\u1ea5u h\u00ecnh trang web WordPress v\u00e0 nhi\u1ec1u c\u00f4ng th\u1ee9c h\u1eefu \u00edch kh\u00e1c. B\u1ea1n c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng th\u00eam b\u1ea5t k\u1ef3 c\u00f4ng th\u1ee9c n\u00e0o \u0111\u01b0\u1ee3c vi\u1ebft s\u1eb5n n\u00e0y v\u00e0o c\u00e2y tr\u1ea1ng th\u00e1i Salt c\u1ee7a ri\u00eang b\u1ea1n b\u1eb1ng GitHub.<\/p>\n<p>H\u01b0\u1edbng d\u1eabn n\u00e0y s\u1ebd s\u1eed d\u1ee5ng GitHub \u0111\u1ec3 ph\u00e2n nh\u00e1nh v\u00e0 s\u1eeda \u0111\u1ed5i&nbsp;<a href=\"https:\/\/github.com\/saltstack-formulas\/timezone-formula\" target=\"_blank\" rel=\"noreferrer noopener\">c\u00f4ng th\u1ee9c m\u00fai gi\u1edd<\/a>&nbsp;c\u1ee7a SaltStack , sau \u0111\u00f3 s\u1eed d\u1ee5ng c\u00f4ng th\u1ee9c tr\u00ean m\u00e1y ch\u1ee7 Salt \u0111\u1ec3 c\u1ea5u h\u00ecnh m\u00fai gi\u1edd tr\u00ean hai minion.<\/p>\n<h2 id=\"before-you-begin\">Tr\u01b0\u1edbc khi b\u1ea1n b\u1eaft \u0111\u1ea7u<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#before-you-begin\"><\/a><\/h2>\n<ol>\n<li>N\u1ebfu b\u1ea1n m\u1edbi s\u1eed d\u1ee5ng SaltStack, h\u00e3y \u0111\u1ecdc&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/beginners-guide-to-salt\/\">H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng Salt cho ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u<\/a>&nbsp;\u0111\u1ec3 l\u00e0m quen v\u1edbi c\u00e1c kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n v\u1ec1 Salt.<\/li>\n<li>T\u1ea3i Git v\u1ec1 m\u00e1y t\u00ednh c\u1ee5c b\u1ed9 c\u1ee7a b\u1ea1n b\u1eb1ng c\u00e1ch l\u00e0m theo h\u01b0\u1edbng d\u1eabn&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/how-to-install-git-on-linux-mac-and-windows\/\">C\u00e1ch c\u00e0i \u0111\u1eb7t Git tr\u00ean Linux, Mac ho\u1eb7c Windows<\/a>&nbsp;c\u1ee7a ch\u00fang t\u00f4i .<\/li>\n<li>L\u00e0m quen v\u1edbi Git b\u1eb1ng h\u01b0\u1edbng d\u1eabn&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/how-to-configure-git\/\">B\u1eaft \u0111\u1ea7u v\u1edbi Git<\/a>&nbsp;c\u1ee7a ch\u00fang t\u00f4i .<\/li>\n<li>H\u00e3y \u0111\u1ea3m b\u1ea3o r\u1eb1ng b\u1ea1n \u0111\u00e3&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/how-to-configure-git\/#configure-git\">c\u1ea5u h\u00ecnh git<\/a>&nbsp;tr\u00ean m\u00e1y t\u00ednh c\u1ee5c b\u1ed9 c\u1ee7a m\u00ecnh.<\/li>\n<li>S\u1eed d\u1ee5ng h\u01b0\u1edbng d\u1eabn&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/getting-started-with-salt-basic-installation-and-setup\/\">B\u1eaft \u0111\u1ea7u v\u1edbi Salt &#8211; C\u00e0i \u0111\u1eb7t v\u00e0 thi\u1ebft l\u1eadp c\u01a1 b\u1ea3n<\/a>&nbsp;\u0111\u1ec3 thi\u1ebft l\u1eadp m\u1ed9t Salt Master v\u00e0 hai Salt minion: m\u1ed9t ch\u1ea1y Ubuntu 18.04 v\u00e0 m\u1ed9t ch\u1ea1y CentOS 7.<\/li>\n<li>Ho\u00e0n th\u00e0nh c\u00e1c ph\u1ea7n trong h\u01b0\u1edbng d\u1eabn&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/products\/compute\/compute-instances\/guides\/set-up-and-secure\/\">Thi\u1ebft l\u1eadp v\u00e0 b\u1ea3o m\u1eadt phi\u00ean b\u1ea3n m\u00e1y t\u00ednh<\/a>&nbsp;c\u1ee7a ch\u00fang t\u00f4i \u0111\u1ec3 t\u1ea1o t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng chu\u1ea9n, t\u0103ng c\u01b0\u1eddng quy\u1ec1n truy c\u1eadp SSH v\u00e0 x\u00f3a c\u00e1c d\u1ecbch v\u1ee5 m\u1ea1ng kh\u00f4ng c\u1ea7n thi\u1ebft.<\/li>\n<\/ol>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: C\u00e1c b\u01b0\u1edbc trong h\u01b0\u1edbng d\u1eabn n\u00e0y y\u00eau c\u1ea7u quy\u1ec1n root. H\u00e3y \u0111\u1ea3m b\u1ea3o ch\u1ea1y c\u00e1c b\u01b0\u1edbc b\u00ean d\u01b0\u1edbi v\u1edbi&nbsp;<code>sudo<\/code> ti\u1ec1n t\u1ed1. \u0110\u1ec3 bi\u1ebft th\u00eam th\u00f4ng tin v\u1ec1 quy\u1ec1n, h\u00e3y xem h\u01b0\u1edbng d\u1eabn&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/linux-users-and-groups\/\">Ng\u01b0\u1eddi d\u00f9ng v\u00e0 Nh\u00f3m<\/a>&nbsp;c\u1ee7a ch\u00fang t\u00f4i .<\/p>\n<h2 id=\"overview-of-the-saltstack-time-zone-formula\">T\u1ed5ng quan v\u1ec1 C\u00f4ng th\u1ee9c m\u00fai gi\u1edd SaltStack<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#overview-of-the-saltstack-time-zone-formula\"><\/a><\/h2>\n<p>Trong ph\u1ea7n n\u00e0y, ch\u00fang ta s\u1ebd xem x\u00e9t k\u1ef9 h\u01a1n v\u1ec1 SaltStack&nbsp;<code>timezone-formula<\/code>, c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 c\u1ea5u h\u00ecnh m\u00fai gi\u1edd c\u1ee7a minion. T\u1ed5ng quan c\u1ea5p cao v\u1ec1 t\u1ea5t c\u1ea3 c\u00e1c t\u1ec7p tr\u1ea1ng th\u00e1i c\u1ee7a c\u00f4ng th\u1ee9c v\u00e0 c\u00e1c m\u1eabu Jinja s\u1ebd \u0111\u01b0\u1ee3c cung c\u1ea5p. C\u00e1c ph\u01b0\u01a1ng ph\u00e1p hay nh\u1ea5t c\u1ee7a Salt khuy\u1ebfn ngh\u1ecb r\u1eb1ng c\u00e1c c\u00f4ng th\u1ee9c n\u00ean t\u00e1ch d\u1eef li\u1ec7u m\u00e0 tr\u1ea1ng th\u00e1i c\u1ea7n kh\u1ecfi ch\u00ednh tr\u1ea1ng th\u00e1i \u0111\u00f3 \u0111\u1ec3 t\u0103ng t\u00ednh linh ho\u1ea1t v\u00e0 kh\u1ea3 n\u0103ng t\u00e1i s\u1eed d\u1ee5ng c\u1ee7a c\u00e1c t\u1ec7p tr\u1ea1ng th\u00e1i. Ch\u00fang ta s\u1ebd quan s\u00e1t c\u00e1ch th\u1ef1c hi\u1ec7n \u0111i\u1ec1u n\u00e0y trong c\u00f4ng th\u1ee9c m\u00fai gi\u1edd.<\/p>\n<ol>\n<li>Trong tr\u00ecnh duy\u1ec7t c\u1ee7a b\u1ea1n, h\u00e3y \u0111i\u1ec1u h\u01b0\u1edbng \u0111\u1ebfn&nbsp;<code>timezone-formula<\/code>trang&nbsp;<a href=\"https:\/\/github.com\/saltstack-formulas\/timezone-formula\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub c\u1ee7a SaltStack<\/a>&nbsp;.&nbsp;<code>README<\/code>T\u1ec7p \u0111\u01b0\u1ee3c hi\u1ec3n th\u1ecb v\u00e0 ch\u1ee9a th\u00f4ng tin c\u01a1 b\u1ea3n v\u1ec1 c\u00f4ng th\u1ee9c. N\u00f3 ghi ch\u00fa c\u00e1c chi ti\u1ebft sau:\n<ul>\n<li>M\u1ee5c \u0111\u00edch c\u1ee7a c\u00f4ng th\u1ee9c: \u0111\u1ec3 c\u1ea5u h\u00ecnh m\u00fai gi\u1edd.<\/li>\n<li>C\u00e1c tr\u1ea1ng th\u00e1i c\u00f3 s\u1eb5n:<code>timezone<\/code><\/li>\n<li>C\u00e1c gi\u00e1 tr\u1ecb m\u1eb7c \u0111\u1ecbnh \u0111\u01b0\u1ee3c cung c\u1ea5p:<code>timezone: 'Europe\/Berlin' utc: True<\/code><\/li>\n<\/ul>\n<p>T\u1ec7p kho l\u01b0u tr\u1eef&nbsp;<code>FORMULA<\/code>bao g\u1ed3m c\u00e1c th\u00f4ng tin chi ti\u1ebft b\u1ed5 sung, bao g\u1ed3m c\u00e1c h\u1ecd h\u1ec7 \u0111i\u1ec1u h\u00e0nh \u0111\u01b0\u1ee3c h\u1ed7 tr\u1ee3 (Debian, RedHat, SUSE, Arch, FreeBSD), t\u00f3m t\u1eaft, m\u00f4 t\u1ea3 v\u00e0 s\u1ed1 b\u1ea3n ph\u00e1t h\u00e0nh.<\/li>\n<li>Khi xem&nbsp;<code>timezone-formula<\/code>, h\u00e3y nh\u1ea5p v\u00e0o&nbsp;<code>timezone<\/code>th\u01b0 m\u1ee5c \u0111\u1ec3 xem n\u1ed9i dung c\u1ee7a n\u00f3. B\u1ea1n s\u1ebd th\u1ea5y c\u00e1c t\u1ec7p sau:<img decoding=\"async\" src=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/timezone-files_hu1e6ca3ff86b4589d22cb8b172b402278_94966_1388x0_resize_q71_bgfafafc_catmullrom_3.jpg\" alt=\"Xem c\u00e1c t\u1eadp tin c\u00f4ng th\u1ee9c m\u00fai gi\u1edd\"><\/li>\n<li>H\u00e3y xem n\u1ed9i dung c\u1ee7a&nbsp;<code>init.sls<\/code>t\u1ec7p x\u00e1c \u0111\u1ecbnh tr\u1ea1ng th\u00e1i m\u00fai gi\u1edd:<\/li>\n<\/ol>\n<pre class=\"wp-block-code\"><code># This state configures the timezone.\n\n{%- set timezone = salt&#91;'pillar.get']('timezone:name', 'Europe\/Berlin') %}\n{%- set utc = salt&#91;'pillar.get']('timezone:utc', True) %}\n{% from \"timezone\/map.jinja\" import confmap with context %}\n\ntimezone_setting:\n  timezone.system:\n    - name: {{ timezone }}\n    - utc: {{ utc }}\n\ntimezone_packages:\n  pkg.installed:\n    - name: {{ confmap.pkgname }}\n\ntimezone_symlink:\n  file.symlink:\n    - name: {{ confmap.path_localtime }}\n    - target: {{ confmap.path_zoneinfo }}{{ timezone }}\n    - force: true\n    - require:\n      - pkg: {{ confmap.pkgname }}\n<\/code><\/pre>\n<p>Salt s\u1ebd di\u1ec5n gi\u1ea3i t\u00ean c\u1ee7a t\u1ec7p n\u00e0y l\u00e0&nbsp;<code>timezone<\/code>, v\u00ec b\u1ea5t k\u1ef3&nbsp;<code>init.sls<\/code>t\u1ec7p n\u00e0o trong th\u01b0 m\u1ee5c con \u0111\u1ec1u \u0111\u01b0\u1ee3c tham chi\u1ebfu theo \u0111\u01b0\u1eddng d\u1eabn c\u1ee7a th\u01b0 m\u1ee5c \u0111\u00f3.T\u1ec7p tr\u1ea1ng th\u00e1i n\u00e0y ch\u1ee9a ba khai b\u00e1o tr\u1ea1ng th\u00e1i,&nbsp;<code>timezone_setting<\/code>,&nbsp;<code>timezone_packages<\/code>v\u00e0&nbsp;<code>timezone_symlink<\/code>. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 m\u00f4 t\u1ea3 v\u1ec1 c\u1ea5u h\u00ecnh m\u00e0 m\u1ed7i khai b\u00e1o s\u1ebd th\u1ef1c hi\u1ec7n tr\u00ean m\u1ed9t minion Salt.<\/p>\n<ul>\n<li><code>timezone.system<\/code><a href=\"https:\/\/docs.saltproject.io\/en\/latest\/ref\/states\/all\/salt.states.timezone.html\" target=\"_blank\" rel=\"noreferrer noopener\">: Tr\u1ea1ng th\u00e1i n\u00e0y s\u1eed d\u1ee5ng m\u00f4-\u0111un tr\u1ea1ng th\u00e1i m\u00fai gi\u1edd<\/a>&nbsp;c\u1ee7a Salt&nbsp;\u0111\u1ec3 qu\u1ea3n l\u00fd m\u00fai gi\u1edd cho minion. C\u00e1c gi\u00e1 tr\u1ecb cho&nbsp;<code>name<\/code>v\u00e0&nbsp;<code>utc<\/code>\u0111\u01b0\u1ee3c l\u1ea5y t\u1eeb t\u1ec7p Pillar c\u1ee7a Salt master t\u01b0\u01a1ng \u1ee9ng. \u0110i\u1ec1u n\u00e0y \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n trong ph\u00e9p g\u00e1n hai bi\u1ebfn \u1edf \u0111\u1ea7u t\u1ec7p:&nbsp;<code>{%- set timezone = salt['pillar.get']('timezone:name', 'Europe\/Berlin') %}<\/code>v\u00e0&nbsp;<code>{%- set utc = salt['pillar.get']('timezone:utc', True) %}<\/code>.<\/li>\n<li><code>timezone_packages:<\/code>Tr\u1ea1ng th\u00e1i n\u00e0y \u0111\u1ea3m b\u1ea3o r\u1eb1ng g\u00f3i c\u1ea7n thi\u1ebft \u0111\u1ec3 c\u1ea5u h\u00ecnh m\u00fai gi\u1edd \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t tr\u00ean minion. Gi\u00e1 tr\u1ecb n\u00e0y \u0111\u01b0\u1ee3c l\u1ea5y t\u1eeb&nbsp;<code>confmap<\/code>bi\u1ebfn \u0111\u01b0\u1ee3c nh\u1eadp t\u1eeb&nbsp;<code>map.jinja<\/code>t\u1ec7p. L\u1ec7nh nh\u1eadp \u0111\u01b0\u1ee3c khai b\u00e1o \u1edf \u0111\u1ea7u t\u1ec7p b\u1eb1ng&nbsp;<code>{% from \"timezone\/map.jinja\" import confmap with context %}<\/code>c\u00e2u l\u1ec7nh nh\u1eadp. Sau \u0111\u00f3 trong ph\u1ea7n n\u00e0y, b\u1ea1n s\u1ebd ki\u1ec3m tra&nbsp;<code>map.jinja<\/code>t\u1ec7p.<\/li>\n<li><code>timezone_symlink<\/code>: Tr\u1ea1ng th\u00e1i n\u00e0y t\u1ea1o ra m\u1ed9t li\u00ean k\u1ebft t\u01b0\u1ee3ng tr\u01b0ng t\u1eeb \u0111\u01b0\u1eddng d\u1eabn \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh trong&nbsp;<code>name<\/code>\u0111\u1ebfn v\u1ecb tr\u00ed \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh trong&nbsp;<code>target<\/code>. Tr\u1ea1ng th\u00e1i n\u00e0y s\u1ebd ch\u1ec9 th\u1ef1c thi n\u1ebfu&nbsp;<code>timezone_packages<\/code>tr\u1ea1ng th\u00e1i \u0111\u01b0\u1ee3c th\u1ef1c thi th\u00e0nh c\u00f4ng. Y\u00eau c\u1ea7u n\u00e0y \u0111\u01b0\u1ee3c bi\u1ec3u th\u1ecb b\u1eb1ng&nbsp;<code>require<\/code>c\u00e2u l\u1ec7nh.<\/li>\n<\/ul>\n<p>1.Ti\u1ebfp theo, h\u00e3y ki\u1ec3m tra&nbsp;<code>map.jinja<\/code>t\u1ec7p:<\/p>\n<pre class=\"wp-block-code\"><code>{% import_yaml \"timezone\/defaults.yaml\" as defaults %}\n{% import_yaml \"timezone\/osfamilymap.yaml\" as osfamilymap %}\n\n{% set osfam = salt&#91;'grains.filter_by'](\n                                        osfamilymap,\n                                        grain='os_family'\n                                        ) or {} %}\n\n{% do salt&#91;'defaults.merge'](defaults, osfam) %}\n\n{%- set confmap = salt&#91;'pillar.get'](\n                                'timezone:lookup',\n                                default=defaults,\n                                merge=True,\n                                ) %}\n      <\/code><\/pre>\n<p>T\u1ec7p&nbsp;<code>map.jinja<\/code>cho ph\u00e9p c\u00f4ng th\u1ee9c tr\u1eebu t\u01b0\u1ee3ng h\u00f3a c\u00e1c gi\u00e1 tr\u1ecb m\u1eb7c \u0111\u1ecbnh t\u0129nh th\u00e0nh m\u1ed9t t\u1eeb \u0111i\u1ec3n ch\u1ee9a d\u1eef li\u1ec7u c\u1ee5 th\u1ec3 c\u1ee7a n\u1ec1n t\u1ea3ng. Hai t\u1eeb \u0111i\u1ec3n ch\u00ednh \u0111\u01b0\u1ee3c \u0111\u1ecbnh ngh\u0129a trong c\u00e1c t\u1ec7p&nbsp;<code>timezone\/defaults.yaml<\/code>v\u00e0&nbsp;<code>timezone\/osfamilymap.yaml<\/code>kho l\u01b0u tr\u1eef.&nbsp;<code>defaults.yml<\/code>T\u1ec7p \u0111\u00f3ng vai tr\u00f2 l\u00e0 t\u1eeb \u0111i\u1ec3n c\u01a1 s\u1edf ch\u1ee9a c\u00e1c gi\u00e1 tr\u1ecb \u0111\u01b0\u1ee3c chia s\u1ebb b\u1edfi t\u1ea5t c\u1ea3 c\u00e1c h\u1ec7 \u0111i\u1ec1u h\u00e0nh, trong khi&nbsp;<code>osfamilymap.yml<\/code>t\u1ec7p l\u01b0u tr\u1eef b\u1ea5t k\u1ef3 gi\u00e1 tr\u1ecb n\u00e0o kh\u00e1c v\u1edbi c\u00e1c gi\u00e1 tr\u1ecb c\u01a1 s\u1edf. B\u1ea5t k\u1ef3 t\u1ec7p n\u00e0o trong c\u00f4ng th\u1ee9c \u0111\u1ec1u c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng c\u00e1c gi\u00e1 tr\u1ecb t\u1eeb \u0111i\u1ec3n n\u00e0y b\u1eb1ng c\u00e1ch nh\u1eadp t\u1ec7p&nbsp;<code>map.jinja<\/code>. Ngo\u00e0i ra, b\u1ea5t k\u1ef3 gi\u00e1 tr\u1ecb t\u1eeb \u0111i\u1ec3n n\u00e0o c\u0169ng c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c ghi \u0111\u00e8 trong t\u1ec7p Pillar. Vi\u1ec7c ghi \u0111\u00e8 c\u00e1c gi\u00e1 tr\u1ecb t\u1eeb \u0111i\u1ec3n s\u1ebd \u0111\u01b0\u1ee3c th\u1ea3o lu\u1eadn trong ph\u1ea7n&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#modify-your-saltstack-formula\">S\u1eeda \u0111\u1ed5i c\u00f4ng th\u1ee9c SaltStack c\u1ee7a b\u1ea1n<\/a>&nbsp;.<\/p>\n<p>2.M\u1edf&nbsp;<code>timezone\/defaults.yaml<\/code>t\u1ec7p v\u00e0&nbsp;<code>timezone\/osfamilymap,yaml<\/code>t\u1ec7p \u0111\u1ec3 xem d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef trong c\u00e1c t\u1ec7p \u0111\u00f3:<\/p>\n<pre class=\"wp-block-code\"><code>    path_localtime: \/etc\/localtime\n    path_zoneinfo: \/usr\/share\/zoneinfo\/\n    pkgname: tzdata\n      <\/code><\/pre>\n<pre class=\"wp-block-code\"><code>    Suse:\n      pkgname: timezone\n    FreeBSD:\n      pkgname: zoneinfo\n    Gentoo:\n      pkgname: sys-libs\/timezone-data\n      <\/code><\/pre>\n<p>C\u00e1c gi\u00e1 tr\u1ecb \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh trong c\u00e1c t\u1ec7p YAML n\u00e0y s\u1ebd \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong&nbsp;<code>init.sls<\/code>t\u1ec7p.<\/p>\n<p>3.M\u1edf&nbsp;<code>pillar.example<\/code>t\u1ec7p \u0111\u1ec3 xem l\u1ea1i n\u1ed9i dung c\u1ee7a n\u00f3:<\/p>\n<pre class=\"wp-block-code\"><code>  timezone:\n    name: 'Europe\/Berlin'\n    utc: True\n      <\/code><\/pre>\n<p>T\u1ec7p n\u00e0y cung c\u1ea5p m\u1ed9t v\u00ed d\u1ee5 \u0111\u1ec3 b\u1ea1n s\u1eed d\u1ee5ng khi t\u1ea1o t\u1ec7p Pillar c\u1ee7a ri\u00eang b\u1ea1n tr\u00ean Salt master. T\u1ec7p&nbsp;<code>init.sls<\/code>s\u1eed d\u1ee5ng c\u00e1c gi\u00e1 tr\u1ecb cho&nbsp;<code>name<\/code>v\u00e0&nbsp;<code>utc<\/code>trong&nbsp;<code>timezone_setting<\/code>khai b\u00e1o tr\u1ea1ng th\u00e1i c\u1ee7a n\u00f3. Gi\u00e1 tr\u1ecb cho&nbsp;<code>name<\/code>s\u1ebd \u0111\u1eb7t m\u00fai gi\u1edd cho minion c\u1ee7a b\u1ea1n. Gi\u00e1 tr\u1ecb boolean cho&nbsp;<code>utc<\/code>x\u00e1c \u0111\u1ecbnh c\u00f3 n\u00ean \u0111\u1eb7t \u0111\u1ed3ng h\u1ed3 ph\u1ea7n c\u1ee9ng c\u1ee7a minion th\u00e0nh UTC hay kh\u00f4ng.<\/p>\n<p>Tham kh\u1ea3o&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_tz_database_time_zones\" target=\"_blank\" rel=\"noreferrer noopener\">m\u00fai gi\u1edd c\u01a1 s\u1edf d\u1eef li\u1ec7u tz<\/a>&nbsp;\u0111\u1ec3 xem danh s\u00e1ch t\u1ea5t c\u1ea3 c\u00e1c m\u00fai gi\u1edd kh\u1ea3 d\u1ee5ng. V\u00ec t\u1ec7p Pillar ch\u1ee9a d\u1eef li\u1ec7u nh\u1ea1y c\u1ea3m, b\u1ea1n kh\u00f4ng n\u00ean ki\u1ec3m so\u00e1t phi\u00ean b\u1ea3n t\u1ec7p n\u00e0y. Trong ph\u1ea7n&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#create-the-pillar\">T\u1ea1o Pillar<\/a>&nbsp;, b\u1ea1n s\u1ebd t\u1ea1o t\u1ec7p Pillar tr\u1ef1c ti\u1ebfp tr\u00ean m\u00e1y ch\u1ee7 Salt c\u1ee7a m\u00ecnh.<\/p>\n<p>B\u00e2y gi\u1edd b\u1ea1n \u0111\u00e3 hi\u1ec3u c\u1ea5u tr\u00fac c\u1ee7a c\u00f4ng th\u1ee9c m\u00fai gi\u1edd SaltStack, trong ph\u1ea7n ti\u1ebfp theo, b\u1ea1n s\u1ebd fork kho l\u01b0u tr\u1eef c\u00f4ng th\u1ee9c tr\u00ean GitHub v\u00e0 sao ch\u00e9p c\u00f4ng th\u1ee9c \u0111\u00e3 fork v\u00e0o m\u00e1y t\u00ednh c\u1ee5c b\u1ed9 c\u1ee7a b\u1ea1n.<\/p>\n<h2 id=\"fork-and-clone-the-saltstack-timezone-formula\">Fork v\u00e0 sao ch\u00e9p c\u00f4ng th\u1ee9c SaltStack TimeZone<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#fork-and-clone-the-saltstack-timezone-formula\"><\/a><\/h2>\n<p>Trong ph\u1ea7n n\u00e0y, b\u1ea1n s\u1ebd fork&nbsp;<code>timezone-formula<\/code>trang GitHub ch\u00ednh th\u1ee9c c\u1ee7a SaltStack sang t\u00e0i kho\u1ea3n GitHub c\u1ee7a b\u1ea1n v\u00e0 sao ch\u00e9p n\u00f3 v\u00e0o kho l\u01b0u tr\u1eef c\u1ee5c b\u1ed9.<\/p>\n<p>1.Trong tr\u00ecnh duy\u1ec7t c\u1ee7a b\u1ea1n, h\u00e3y \u0111i\u1ec1u h\u01b0\u1edbng \u0111\u1ebfn trang GitHub&nbsp;<code>timezone-formula<\/code>c\u1ee7a&nbsp;<a href=\"https:\/\/github.com\/saltstack-formulas\/timezone-formula\" target=\"_blank\" rel=\"noreferrer noopener\">SaltStack<\/a>&nbsp;. N\u1ebfu b\u1ea1n ch\u01b0a \u0111\u0103ng nh\u1eadp v\u00e0o t\u00e0i kho\u1ea3n GitHub c\u1ee7a m\u00ecnh, h\u00e3y nh\u1ea5p v\u00e0o li\u00ean k\u1ebft&nbsp;<strong>\u0110\u0103ng nh\u1eadp<\/strong>&nbsp;\u1edf \u0111\u1ea7u trang v\u00e0 \u0111\u0103ng nh\u1eadp.<\/p>\n<p>2.L\u1ea5y c\u00f4ng th\u1ee9c m\u00fai gi\u1edd t\u1eeb trang GitHub c\u1ee7a c\u00f4ng th\u1ee9c SaltStack:<img decoding=\"async\" src=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/fork-timezone-formula_hu1cc6376ca4fad7359d292dfcd8dd87aa_121948_1388x0_resize_q71_bgfafafc_catmullrom_3.jpg\" alt=\"C\u00f4ng th\u1ee9c m\u00fai gi\u1edd SaltStack Fork\">Sau khi c\u00f4ng th\u1ee9c \u0111\u01b0\u1ee3c ph\u00e2n nh\u00e1nh, b\u1ea1n s\u1ebd \u0111\u01b0\u1ee3c chuy\u1ec3n h\u01b0\u1edbng \u0111\u1ebfn nh\u00e1nh c\u00f4ng th\u1ee9c m\u00fai gi\u1edd c\u1ee7a t\u00e0i kho\u1ea3n GitHub c\u1ee7a b\u1ea1n.<\/p>\n<p>3.Khi xem nh\u00e1nh c\u00f4ng th\u1ee9c m\u00fai gi\u1edd c\u1ee7a b\u1ea1n, h\u00e3y nh\u1ea5p v\u00e0o n\u00fat&nbsp;<strong>Sao ch\u00e9p ho\u1eb7c t\u1ea3i xu\u1ed1ng<\/strong>&nbsp;v\u00e0 sao ch\u00e9p URL:<img decoding=\"async\" src=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/clone-timezone-formula_hucb00421d1da872f3cb075db7549742df_124266_1388x0_resize_q71_bgfafafc_catmullrom_3.jpg\" alt=\"C\u00f4ng th\u1ee9c m\u00fai gi\u1edd SaltStack Fork\"><\/p>\n<p>4.Tr\u00ean m\u00e1y t\u00ednh c\u1ee5c b\u1ed9 c\u1ee7a b\u1ea1n, h\u00e3y sao ch\u00e9p c\u00f4ng th\u1ee9c m\u00fai gi\u1edd:<\/p>\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/my-github\/timezone-formula.git<\/code><\/pre>\n<p>5.Di chuy\u1ec3n v\u00e0o&nbsp;<code>timezone-formula<\/code>th\u01b0 m\u1ee5c:<\/p>\n<pre class=\"wp-block-code\"><code>cd timezone-formula\n<\/code><\/pre>\n<p>6.Hi\u1ec3n th\u1ecb n\u1ed9i dung c\u1ee7a&nbsp;<code>timezone-formula<\/code>th\u01b0 m\u1ee5c:<\/p>\n<pre class=\"wp-block-code\"><code>ls<\/code><\/pre>\n<p>B\u1ea1n s\u1ebd th\u1ea5y k\u1ebft qu\u1ea3 sau:<\/p>\n<pre class=\"wp-block-code\"><code>      FORMULA        README.rst     pillar.example timezone\n<\/code><\/pre>\n<p>7.Khi b\u1ea1n sao ch\u00e9p m\u1ed9t kho l\u01b0u tr\u1eef, Git s\u1ebd t\u1ef1 \u0111\u1ed9ng \u0111\u1eb7t&nbsp;<code>origin<\/code>remote \u0111\u1ebfn v\u1ecb tr\u00ed c\u1ee7a kho l\u01b0u tr\u1eef \u0111\u00e3 ph\u00e2n nh\u00e1nh. X\u00e1c minh remote \u0111\u00e3 c\u1ea5u h\u00ecnh cho&nbsp;<code>timezone-formula<\/code>kho l\u01b0u tr\u1eef c\u1ee7a b\u1ea1n:<\/p>\n<pre class=\"wp-block-code\"><code>git remote -v\n<\/code><\/pre>\n<p>\u0110\u1ea7u ra c\u1ee7a b\u1ea1n s\u1ebd t\u01b0\u01a1ng t\u1ef1 nh\u01b0 nh\u1eefng g\u00ec hi\u1ec3n th\u1ecb b\u00ean d\u01b0\u1edbi, tuy nhi\u00ean, n\u00f3 s\u1ebd tr\u1ecf t\u1edbi nh\u00e1nh&nbsp;<code>timezone-formula<\/code>kho l\u01b0u tr\u1eef c\u1ee7a ri\u00eang b\u1ea1n:<\/p>\n<pre class=\"wp-block-code\"><code> origin\thttps:\/\/github.com\/my-github\/timezone-formula.git (fetch)\n origin\thttps:\/\/github.com\/my-github\/timezone-formula.git (push)<\/code><\/pre>\n<p>B\u1ea1n c\u00f3 th\u1ec3 th\u00eam c\u00f4ng th\u1ee9c m\u00fai gi\u1edd SaltStack ch\u00ednh th\u1ee9c l\u00e0m c\u00f4ng th\u1ee9c&nbsp;<code>upstream<\/code>t\u1eeb xa, \u0111\u1ec3 b\u1ea1n c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng k\u00e9o b\u1ea5t k\u1ef3 thay \u0111\u1ed5i n\u00e0o \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n \u0111\u1ed1i v\u1edbi c\u00f4ng th\u1ee9c do ng\u01b0\u1eddi b\u1ea3o tr\u00ec kho l\u01b0u tr\u1eef th\u1ef1c hi\u1ec7n ho\u1eb7c \u0111\u00f3ng g\u00f3p tr\u1edf l\u1ea1i cho d\u1ef1 \u00e1n. B\u01b0\u1edbc n\u00e0y kh\u00f4ng b\u1eaft bu\u1ed9c.<\/p>\n<pre class=\"wp-block-code\"><code>git remote add upstream https:\/\/github.com\/saltstack-formulas\/timezone-formula\n<\/code><\/pre>\n<p>B\u00e2y gi\u1edd b\u1ea1n \u0111\u00e3 c\u00f3 b\u1ea3n sao c\u1ee5c b\u1ed9 c\u1ee7a fork&nbsp;<code>timezone-formula<\/code>. Trong ph\u1ea7n ti\u1ebfp theo, b\u1ea1n s\u1ebd s\u1eeda \u0111\u1ed5i c\u00f4ng th\u1ee9c \u0111\u1ec3 c\u1eadp nh\u1eadt t\u1ec7p&nbsp;<code>init.sls<\/code>.<\/p>\n<h2 id=\"modify-your-saltstack-formula\">S\u1eeda \u0111\u1ed5i c\u00f4ng th\u1ee9c SaltStack c\u1ee7a b\u1ea1n<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#modify-your-saltstack-formula\"><\/a><\/h2>\n<p>Trong ph\u1ea7n n\u00e0y, b\u1ea1n s\u1ebd s\u1eeda \u0111\u1ed5i c\u00f4ng th\u1ee9c m\u00fai gi\u1edd \u0111\u1ec3 c\u1ea3i thi\u1ec7n c\u00e1ch c\u00f4ng th\u1ee9c tu\u00e2n theo c\u00e1c th\u00f4ng l\u1ec7 t\u1ed1t nh\u1ea5t c\u1ee7a Salt li\u00ean quan \u0111\u1ebfn t\u1eeb \u0111i\u1ec3n tra c\u1ee9u. T\u01b0\u01a1ng t\u1ef1, b\u1ea1n c\u00f3 th\u1ec3 s\u1eeda \u0111\u1ed5i b\u1ea5t k\u1ef3 c\u00f4ng th\u1ee9c SaltStack n\u00e0o cho c\u00e1c y\u00eau c\u1ea7u c\u1ee5 th\u1ec3 c\u1ee7a c\u01a1 s\u1edf h\u1ea1 t\u1ea7ng c\u1ee7a m\u00ecnh, n\u1ebfu c\u1ea7n.<\/p>\n<p>Nh\u01b0 \u0111\u00e3 th\u1ea3o lu\u1eadn trong ph\u1ea7n&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#overview\">T\u1ed5ng quan v\u1ec1 c\u00f4ng th\u1ee9c m\u00fai gi\u1edd SaltStack<\/a>&nbsp;,&nbsp;<code>timezone\/defaults.yaml<\/code>t\u1ec7p v\u00e0&nbsp;<code>timezone\/osfamily.map<\/code>t\u1ec7p cung c\u1ea5p t\u1eeb \u0111i\u1ec3n c\u00e1c gi\u00e1 tr\u1ecb \u0111\u01b0\u1ee3c tr\u1ea1ng th\u00e1i s\u1eed d\u1ee5ng&nbsp;<code>init.sls<\/code>. C\u00e1c gi\u00e1 tr\u1ecb t\u1eeb \u0111i\u1ec3n t\u1ec7p YAML n\u00e0y c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c ghi \u0111\u00e8 trong t\u1ec7p Pillar c\u0169ng l\u01b0u tr\u1eef b\u1ea5t k\u1ef3 d\u1eef li\u1ec7u nh\u1ea1y c\u1ea3m n\u00e0o m\u00e0 tr\u1ea1ng th\u00e1i c\u1ea7n&nbsp;<code>init.sls<\/code>.<\/p>\n<p>Khi c\u1ea5u tr\u00fac d\u1eef li\u1ec7u Pillar, t\u00e0i li\u1ec7u ch\u00ednh th\u1ee9c c\u1ee7a Salt n\u00eau r\u1eb1ng c\u00e1ch th\u1ef1c h\u00e0nh t\u1ed1t nh\u1ea5t l\u00e0 t\u1ea1o c\u00f4ng th\u1ee9c mong \u0111\u1ee3i t\u1ea5t c\u1ea3 c\u00e1c tham s\u1ed1 li\u00ean quan \u0111\u1ebfn c\u00f4ng th\u1ee9c \u0111\u01b0\u1ee3c \u0111\u1eb7t d\u01b0\u1edbi&nbsp;<code>lookup<\/code>kh\u00f3a c\u1ea5p hai. Hi\u1ec7n t\u1ea1i,&nbsp;<code>init.sls<\/code>t\u1ec7p&nbsp;<code>timezone<\/code>v\u00e0&nbsp;<code>utc<\/code>bi\u1ebfn mong \u0111\u1ee3i d\u1eef li\u1ec7u Pillar \u0111\u01b0\u1ee3c c\u1ea5u tr\u00fac kh\u00e1c nhau. B\u1ea1n s\u1ebd c\u1eadp nh\u1eadt hai c\u00e2u l\u1ec7nh bi\u1ebfn n\u00e0y \u0111\u1ec3 mong \u0111\u1ee3i&nbsp;<code>lookup<\/code>kh\u00f3a c\u1ea5p hai.<\/p>\n<p>1.T\u1ea1o m\u1ed9t nh\u00e1nh m\u1edbi trong kho l\u01b0u tr\u1eef c\u1ee5c b\u1ed9 c\u1ee7a b\u1ea1n \u0111\u1ec3 b\u1eaft \u0111\u1ea7u s\u1eeda \u0111\u1ed5i c\u00f4ng th\u1ee9c m\u00fai gi\u1edd:<\/p>\n<pre class=\"wp-block-code\"><code>git checkout -b update-variable-statements<\/code><\/pre>\n<p>2.M\u1edf&nbsp;<code>init.sls<\/code>t\u1ec7p trong tr\u00ecnh so\u1ea1n th\u1ea3o v\u0103n b\u1ea3n v\u00e0 s\u1eeda \u0111\u1ed5i c\u00e1c c\u00e2u l\u1ec7nh&nbsp;<code>timezone<\/code>v\u00e0&nbsp;<code>utc<\/code>bi\u1ebfn c\u1ee7a t\u1ec7p \u0111\u1ec3 ph\u00f9 h\u1ee3p v\u1edbi t\u1ec7p v\u00ed d\u1ee5:<\/p>\n<pre class=\"wp-block-code\"><code># This state configures the timezone.\n\n{%- set timezone = salt&#91;'pillar.get']('timezone:lookup:name', 'Europe\/Berlin') %}\n{%- set utc = salt&#91;'pillar.get']('timezone:lookup:utc', True) %}\n{% from \"timezone\/map.jinja\" import confmap with context %}\n\ntimezone_setting:\n  timezone.system:\n    - name: {{ timezone }}\n    - utc: {{ utc }}\n\ntimezone_packages:\n  pkg.installed:\n    - name: {{ confmap.pkgname }}\n\ntimezone_symlink:\n  file.symlink:\n    - name: {{ confmap.path_localtime }}\n    - target: {{ confmap.path_zoneinfo }}{{ timezone }}\n    - force: true\n    - require:\n      - pkg: {{ confmap.pkgname }}\n      <\/code><\/pre>\n<p>T\u1ec7p&nbsp;<code>init.sls<\/code>hi\u1ec7n mong \u0111\u1ee3i kh\u00f3a tra c\u1ee9u c\u1ea5p hai khi truy xu\u1ea5t c\u00e1c gi\u00e1 tr\u1ecb Pillar \u0111\u00e3 ch\u1ec9 \u0111\u1ecbnh. Th\u1ef1c hi\u1ec7n theo quy \u01b0\u1edbc n\u00e0y s\u1ebd gi\u00fap ghi \u0111\u00e8 c\u00e1c gi\u00e1 tr\u1ecb t\u1eeb \u0111i\u1ec3n trong t\u1ec7p Pillar c\u1ee7a b\u1ea1n d\u1ec5 d\u00e0ng h\u01a1n. B\u1ea1n s\u1ebd t\u1ea1o t\u1ec7p Pillar trong ph\u1ea7n&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#installing-a-salt-formula\">C\u00e0i \u0111\u1eb7t c\u00f4ng th\u1ee9c Salt<\/a>&nbsp;c\u1ee7a h\u01b0\u1edbng d\u1eabn n\u00e0y.<\/p>\n<p>3.S\u1eed d\u1ee5ng Git \u0111\u1ec3 xem nh\u1eefng t\u1ec7p n\u00e0o \u0111\u00e3 \u0111\u01b0\u1ee3c thay \u0111\u1ed5i tr\u01b0\u1edbc khi d\u00e0n d\u1ef1ng ch\u00fang:<\/p>\n<pre class=\"wp-block-code\"><code>git status\n<\/code><\/pre>\n<p>\u0110\u1ea7u ra c\u1ee7a b\u1ea1n s\u1ebd gi\u1ed1ng nh\u01b0 sau:<\/p>\n<pre class=\"wp-block-code\"><code>On branch update-variable-statements\nChanges not staged for commit:\n  &amp;nbsp&amp;nbsp(use \"git add &amp;ltfile&amp;gt...\" to update what will be committed)\n  &amp;nbsp&amp;nbsp(use \"git checkout -- &amp;ltfile&amp;gt...\" to discard changes in working directory)\n\n  &amp;nbsp&amp;nbspmodified:   timezone\/init.sls\n\nno changes added to commit (use \"git add\" and\/or \"git commit -a\")<\/code><\/pre>\n<p>4.Ph\u00e2n chia v\u00e0 x\u00e1c nh\u1eadn nh\u1eefng thay \u0111\u1ed5i b\u1ea1n \u0111\u00e3 th\u1ef1c hi\u1ec7n v\u00e0o&nbsp;<code>init.sls<\/code>t\u1ec7p.<\/p>\n<pre class=\"wp-block-code\"><code>git add -A\ngit commit -m 'My commit message'<\/code><\/pre>\n<p>5.\u0110\u1ea9y nh\u1eefng thay \u0111\u1ed5i c\u1ee7a b\u1ea1n v\u00e0o nh\u00e1nh c\u1ee7a b\u1ea1n:<\/p>\n<pre class=\"wp-block-code\"><code>git push origin update-variable-statements\n<\/code><\/pre>\n<p>6.\u0110i\u1ec1u h\u01b0\u1edbng \u0111\u1ebfn kho l\u01b0u tr\u1eef GitHub t\u1eeb xa c\u1ee7a c\u00f4ng th\u1ee9c m\u00fai gi\u1edd c\u1ee7a b\u1ea1n v\u00e0 t\u1ea1o y\u00eau c\u1ea7u k\u00e9o \u0111\u1ed1i v\u1edbi nh\u00e1nh fork c\u1ee7a b\u1ea1n&nbsp;<code>master<\/code>.<img decoding=\"async\" src=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/update-variables-pull-request_hu8f853ffef1d728a2a2d937ec54f6d170_141142_1388x0_resize_q71_bgfafafc_catmullrom_3.jpg\" alt=\"G\u1eedi y\u00eau c\u1ea7u k\u00e9o\">H\u00e3y \u0111\u1ea3m b\u1ea3o r\u1eb1ng b\u1ea1n ch\u1ecdn nh\u00e1nh c\u00f4ng th\u1ee9c m\u00fai gi\u1edd c\u1ee7a ri\u00eang m\u00ecnh l\u00e0m&nbsp;<code>base fork<\/code>, n\u1ebfu kh\u00f4ng, b\u1ea1n s\u1ebd g\u1eedi y\u00eau c\u1ea7u k\u00e9o t\u1edbi kho l\u01b0u tr\u1eef c\u00f4ng th\u1ee9c m\u00fai gi\u1edd SaltStack ch\u00ednh th\u1ee9c, \u0111\u00e2y kh\u00f4ng ph\u1ea3i l\u00e0 h\u00e0nh vi mong mu\u1ed1n cho v\u00ed d\u1ee5 n\u00e0y.<img decoding=\"async\" src=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/create-pull-request_huc1d9e0e4f656814cb83331b4bacba760_100408_1388x0_resize_q71_bgfafafc_catmullrom_3.jpg\" alt=\"T\u1ea1o y\u00eau c\u1ea7u k\u00e9o\">N\u1ebfu b\u1ea1n h\u00e0i l\u00f2ng v\u1edbi nh\u1eefng thay \u0111\u1ed5i trong y\u00eau c\u1ea7u k\u00e9o, h\u00e3y h\u1ee3p nh\u1ea5t y\u00eau c\u1ea7u k\u00e9o v\u00e0o&nbsp;<code>master<\/code>nh\u00e1nh c\u1ee7a b\u1ea1n.<img decoding=\"async\" src=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/merge-pull-request_hu6a9ef2bd9fe885f363860489d3d1aa92_144923_1388x0_resize_q71_bgfafafc_catmullrom_3.jpg\" alt=\"H\u1ee3p nh\u1ea5t m\u1ed9t y\u00eau c\u1ea7u k\u00e9o\">Trong ph\u1ea7n ti\u1ebfp theo, b\u1ea1n s\u1ebd th\u00eam nh\u00e1nh c\u1ee7a m\u00ecnh&nbsp;<code>timezone-formula<\/code>v\u00e0o Salt master, t\u1ea1o t\u1ec7p Pillar cho&nbsp;<code>timezone-formula<\/code>v\u00e0 \u00e1p d\u1ee5ng c\u00e1c thay \u0111\u1ed5i cho minion c\u1ee7a b\u1ea1n.<\/p>\n<h2 id=\"install-a-salt-formula\">C\u00e0i \u0111\u1eb7t c\u00f4ng th\u1ee9c Salt&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#install-a-salt-formula\"><\/a><\/h2>\n<p>C\u00f3 hai c\u00e1ch \u0111\u1ec3 s\u1eed d\u1ee5ng Salt Formula: b\u1ea1n c\u00f3 th\u1ec3 th\u00eam c\u00f4ng th\u1ee9c d\u01b0\u1edbi d\u1ea1ng GitFS Remote, cho ph\u00e9p b\u1ea1n ph\u1ee5c v\u1ee5 tr\u1ef1c ti\u1ebfp c\u00e1c t\u1ec7p \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef tr\u00ean t\u00e0i kho\u1ea3n GitHub c\u1ee7a m\u00ecnh ho\u1eb7c b\u1ea1n c\u00f3 th\u1ec3 th\u00eam c\u00f4ng th\u1ee9c tr\u1ef1c ti\u1ebfp v\u00e0o Salt master b\u1eb1ng c\u01a1 ch\u1ebf sao ch\u00e9p c\u1ee7a Git. Ph\u1ea7n n\u00e0y s\u1ebd \u0111\u1ec1 c\u1eadp \u0111\u1ebfn c\u1ea3 hai c\u00e1ch s\u1eed d\u1ee5ng Salt formulas.<\/p>\n<h3 id=\"manually-add-a-salt-formula-to-your-master\">Th\u00eam c\u00f4ng th\u1ee9c Salt&nbsp; v\u00e0o Master c\u1ee7a b\u1ea1n theo c\u00e1ch th\u1ee7 c\u00f4ng<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#manually-add-a-salt-formula-to-your-master\"><\/a><\/h3>\n<p>1.\u0110i\u1ec1u h\u01b0\u1edbng \u0111\u1ebfn nh\u00e1nh c\u00f4ng th\u1ee9c m\u00fai gi\u1edd c\u1ee7a b\u1ea1n, nh\u1ea5p v\u00e0o n\u00fat&nbsp;<strong>Sao ch\u00e9p ho\u1eb7c t\u1ea3i xu\u1ed1ng<\/strong>&nbsp;v\u00e0 sao ch\u00e9p URL c\u1ee7a kho l\u01b0u tr\u1eef v\u00e0o b\u1ea3ng t\u1ea1m c\u1ee7a b\u1ea1n.<\/p>\n<p>2.SSH v\u00e0o m\u00e1y ch\u1ee7 Salt c\u1ee7a b\u1ea1n. Thay th\u1ebf&nbsp;<code>username<\/code>b\u1eb1ng t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng gi\u1edbi h\u1ea1n c\u1ee7a b\u1ea1n v\u00e0 thay th\u1ebf&nbsp;<code>198.51.100.0<\/code>b\u1eb1ng \u0111\u1ecba ch\u1ec9 IP c\u1ee7a Linode:<code> <\/code><\/p>\n<pre class=\"wp-block-code\"><code>ssh username@198.51.100.0\n<\/code><\/pre>\n<p>3.T\u1ea1o m\u1ed9t th\u01b0 m\u1ee5c c\u00f4ng th\u1ee9c v\u00e0 chuy\u1ec3n t\u1edbi th\u01b0 m\u1ee5c m\u1edbi:<code> <\/code><\/p>\n<pre class=\"wp-block-code\"><code>mkdir -p \/srv\/formulas\ncd \/srv\/formulas<\/code><\/pre>\n<p>4.N\u1ebfu m\u00e1y ch\u1ee7 Salt c\u1ee7a b\u1ea1n ch\u01b0a c\u00e0i \u0111\u1eb7t Git, h\u00e3y c\u00e0i \u0111\u1eb7t Git b\u1eb1ng tr\u00ecnh qu\u1ea3n l\u00fd g\u00f3i c\u1ee7a h\u1ec7 th\u1ed1ng:<\/p>\n<p><strong>Ubuntu\/Debian<\/strong><code> <\/code><\/p>\n<pre class=\"wp-block-code\"><code>apt-get update\napt-get install git<\/code><\/pre>\n<p><strong>Centos<\/strong><code> <\/code><\/p>\n<pre class=\"wp-block-code\"><code>yum update\nyum install git<\/code><\/pre>\n<p>5.Sao ch\u00e9p kho l\u01b0u tr\u1eef v\u00e0o&nbsp;<code>\/srv\/formulas<\/code>th\u01b0 m\u1ee5c. \u0110\u1ea3m b\u1ea3o b\u1ea1n thay th\u1ebf&nbsp;<code>git-username<\/code>b\u1eb1ng t\u00ean ng\u01b0\u1eddi d\u00f9ng c\u1ee7a ri\u00eang b\u1ea1n:<code> <\/code><\/p>\n<pre class=\"wp-block-code\"><code><code>git clone https:\/\/github.com\/git-username\/timezone-formula.git<\/code><\/code><\/pre>\n<h3 id=\"add-a-salt-formula-as-a-gitfs-remote\">Th\u00eam c\u00f4ng th\u1ee9c Salt l\u00e0m GitFS Remote<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#add-a-salt-formula-as-a-gitfs-remote\"><\/a><\/h3>\n<p>GitFs cho ph\u00e9p Salt ph\u1ee5c v\u1ee5 c\u00e1c t\u1ec7p tr\u1ef1c ti\u1ebfp t\u1eeb kho l\u01b0u tr\u1eef git t\u1eeb xa. \u0110\u00e2y l\u00e0 c\u00e1ch thu\u1eadn ti\u1ec7n \u0111\u1ec3 s\u1eed d\u1ee5ng c\u00e1c c\u00f4ng th\u1ee9c Salt v\u1edbi t\u00ednh linh ho\u1ea1t v\u00e0 s\u1ee9c m\u1ea1nh b\u1ed5 sung m\u00e0 c\u00e1c h\u1ec7 th\u1ed1ng ki\u1ec3m so\u00e1t phi\u00ean b\u1ea3n t\u1eeb xa cung c\u1ea5p, nh\u01b0 c\u1ed9ng t\u00e1c v\u00e0 d\u1ec5 d\u00e0ng quay l\u1ea1i c\u00e1c phi\u00ean b\u1ea3n tr\u01b0\u1edbc c\u1ee7a c\u00f4ng th\u1ee9c c\u1ee7a b\u1ea1n.<\/p>\n<p>1.Tr\u00ean m\u00e1y ch\u1ee7 Salt, c\u00e0i \u0111\u1eb7t giao di\u1ec7n Python v\u00e0o Git:<\/p>\n<pre class=\"wp-block-code\"><code>sudo apt-get install python-git\n<\/code><\/pre>\n<p>2.Ch\u1ec9nh s\u1eeda t\u1ec7p c\u1ea5u h\u00ecnh ch\u00ednh Salt \u0111\u1ec3 s\u1eed d\u1ee5ng GitFs l\u00e0m backend m\u00e1y ch\u1ee7 t\u1ec7p. \u0110\u1ea3m b\u1ea3o c\u00e1c d\u00f2ng \u0111\u01b0\u1ee3c li\u1ec7t k\u00ea b\u00ean d\u01b0\u1edbi kh\u00f4ng c\u00f3 ch\u00fa th\u00edch trong t\u1ec7p c\u1ea5u h\u00ecnh ch\u00ednh c\u1ee7a b\u1ea1n:<\/p>\n<pre class=\"wp-block-code\"><code>fileserver_backend:\n  - gitfs\n  - roots<\/code><\/pre>\n<p>Khi s\u1eed d\u1ee5ng nhi\u1ec1u ch\u01b0\u01a1ng tr\u00ecnh ph\u1ee5 tr\u1ee3, b\u1ea1n n\u00ean li\u1ec7t k\u00ea t\u1ea5t c\u1ea3 c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh ph\u1ee5 tr\u1ee3 theo th\u1ee9 t\u1ef1 b\u1ea1n mu\u1ed1n t\u00ecm ki\u1ebfm.&nbsp;<code>roots<\/code>l\u00e0 ch\u01b0\u01a1ng tr\u00ecnh ph\u1ee5 tr\u1ee3 m\u00e1y ch\u1ee7 t\u1ec7p \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 ph\u1ee5c v\u1ee5 c\u00e1c t\u1ec7p t\u1eeb b\u1ea5t k\u1ef3 th\u01b0 m\u1ee5c n\u00e0o c\u1ee7a m\u00e1y ch\u1ee7 ch\u00ednh \u0111\u01b0\u1ee3c li\u1ec7t k\u00ea trong&nbsp;<code>file_roots<\/code>c\u1ea5u h\u00ecnh.<\/p>\n<p>3.Trong c\u00f9ng m\u1ed9t t\u1ec7p c\u1ea5u h\u00ecnh Salt master, h\u00e3y th\u00eam v\u1ecb tr\u00ed c\u1ee7a kho l\u01b0u tr\u1eef GitHub c\u1ee7a c\u00f4ng th\u1ee9c m\u00fai gi\u1edd c\u1ee7a b\u1ea1n. \u0110\u1ea3m b\u1ea3o b\u1ea1n \u0111\u00e3 b\u1ecf ch\u00fa th\u00edch&nbsp;<code>gitfs_remote<\/code>:<\/p>\n<pre class=\"wp-block-code\"><code>gitfs_remotes:\n  - https:\/\/github.com\/git-username\/timezone-formula.git<\/code><\/pre>\n<p>4.B\u1ecf ch\u00fa th\u00edch cho&nbsp;<code>gitfs_provider<\/code>ph\u1ea7n khai b\u00e1o v\u00e0 \u0111\u1eb7t gi\u00e1 tr\u1ecb c\u1ee7a n\u00f3 th\u00e0nh gitpython:<\/p>\n<pre class=\"wp-block-code\"><code>gitfs_provider: gitpython<\/code><\/pre>\n<p>5.Kh\u1edfi \u0111\u1ed9ng l\u1ea1i Salt master \u0111\u1ec3 \u00e1p d\u1ee5ng c\u1ea5u h\u00ecnh m\u1edbi:<\/p>\n<pre class=\"wp-block-code\"><code>sudo systemctl restart salt-master\n<\/code><\/pre>\n<h3 id=\"add-a-salt-formula-to-the-top-file\">Th\u00eam c\u00f4ng th\u1ee9c Salt v\u00e0o t\u1ec7p tr\u00ean c\u00f9ng<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#add-a-salt-formula-to-the-top-file\"><\/a><\/h3>\n<p>\u0110\u1ec3 \u0111\u01b0a c\u00f4ng th\u1ee9c m\u00fai gi\u1edd v\u00e0o c\u00e2y tr\u1ea1ng th\u00e1i Salt, b\u1ea1n ph\u1ea3i th\u00eam n\u00f3 v\u00e0o t\u1ec7p tr\u00ean c\u00f9ng.<\/p>\n<p>1.T\u1ea1o&nbsp;<code>\/srv\/salt<\/code>th\u01b0 m\u1ee5c n\u1ebfu n\u00f3 ch\u01b0a t\u1ed3n t\u1ea1i:<\/p>\n<pre class=\"wp-block-code\"><code>mkdir \/srv\/salt\n<\/code><\/pre>\n<p>2.Th\u00eam&nbsp;<code>timezone<\/code>tr\u1ea1ng th\u00e1i \u0111\u01b0\u1ee3c khai b\u00e1o trong&nbsp;<code>timezone-formula<\/code>t\u1ec7p tr\u00ean c\u00f9ng c\u1ee7a b\u1ea1n:<\/p>\n<pre class=\"wp-block-code\"><code>base:\n  '*':\n    - timezone\n<\/code><\/pre>\n<p>V\u00ed d\u1ee5 t\u1ec7p Top khai b\u00e1o m\u1ed9t m\u00f4i tr\u01b0\u1eddng,&nbsp;<code>base<\/code>m\u00f4i tr\u01b0\u1eddng nh\u1eafm m\u1ee5c ti\u00eau \u0111\u1ebfn t\u1ea5t c\u1ea3 c\u00e1c minion v\u00e0 \u00e1p d\u1ee5ng&nbsp;<code>timezone<\/code>tr\u1ea1ng th\u00e1i cho ch\u00fang. T\u1ec7p top n\u00e0y c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng ch\u1ee9a m\u1ed9t s\u1ed1 tr\u1ea1ng th\u00e1i \u0111\u00e3 t\u1ed3n t\u1ea1i trong c\u00e2y tr\u1ea1ng th\u00e1i c\u1ee7a b\u1ea1n, nh\u01b0 m\u1ed9t&nbsp;<code>apache<\/code>tr\u1ea1ng th\u00e1i, m\u1ed9t&nbsp;<code>wordpress<\/code>tr\u1ea1ng th\u00e1i, v.v. v\u00e0 m\u1ed9t s\u1ed1 m\u00f4i tr\u01b0\u1eddng nh\u1eafm m\u1ee5c ti\u00eau \u0111\u1ebfn c\u00e1c minion kh\u00e1c nhau. B\u1ea5t k\u1ef3 c\u00f4ng th\u1ee9c Salt n\u00e0o c\u0169ng c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng \u0111\u01b0\u1ee3c \u0111\u01b0a v\u00e0o t\u1ec7p top v\u00e0 s\u1ebd \u0111\u01b0\u1ee3c \u00e1p d\u1ee5ng cho c\u00e1c minion \u0111\u01b0\u1ee3c nh\u1eafm m\u1ee5c ti\u00eau v\u00e0o l\u1ea7n ti\u1ebfp theo b\u1ea1n ch\u1ea1y highstate.<\/p>\n<h3 id=\"create-the-pillar\">T\u1ea1o the Pillar<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#create-the-pillar\"><\/a><\/h3>\n<p>1.T\u1ea1o m\u1ed9t th\u01b0 m\u1ee5c \u0111\u1ec3 l\u01b0u tr\u1eef t\u1ec7p Pillar c\u1ee7a c\u00f4ng th\u1ee9c c\u1ee7a b\u1ea1n:<\/p>\n<pre class=\"wp-block-code\"><code>mkdir -p \/srv\/pillar<\/code><\/pre>\n<p>2.T\u1ea1o t\u1ec7p Pillar \u0111\u1ec3 l\u01b0u tr\u1eef d\u1eef li\u1ec7u s\u1ebd \u0111\u01b0\u1ee3c c\u00f4ng th\u1ee9c m\u00fai gi\u1edd c\u1ee7a b\u1ea1n s\u1eed d\u1ee5ng:<\/p>\n<pre class=\"wp-block-code\"><code>timezone:\n  lookup:\n    {%- if grains&#91;'os_family'] == 'Debian' %}\n    name: America\/New_York\n    {%- else %}\n    name: 'Europe\/Berlin'\n    {%- endif %}\n    utc: True\n    <\/code><\/pre>\n<p>T\u1ec7p&nbsp;<code>timezone.sls<\/code>Pillar \u0111\u01b0\u1ee3c t\u1ea1o t\u1eeb&nbsp;<code>pillar.example<\/code>t\u1ec7p \u0111\u01b0\u1ee3c cung c\u1ea5p trong c\u00f4ng th\u1ee9c m\u00fai gi\u1edd SaltStack. V\u00ed d\u1ee5 \u0111\u00e3 \u0111\u01b0\u1ee3c s\u1eeda \u0111\u1ed5i \u0111\u1ec3 th\u00eam c\u00e1c c\u00e2u l\u1ec7nh \u0111i\u1ec1u khi\u1ec3n Jinja s\u1ebd g\u00e1n m\u1ed9t m\u00fai gi\u1edd kh\u00e1c tr\u00ean b\u1ea5t k\u1ef3 minion n\u00e0o l\u00e0 H\u0110H h\u1ecd Debian. B\u1ea1n c\u00f3 th\u1ec3 thay th\u1ebf b\u1ea5t k\u1ef3&nbsp;<code>name<\/code>gi\u00e1 tr\u1ecb m\u00fai gi\u1edd n\u00e0o th\u00e0nh m\u00fai gi\u1edd \u01b0a th\u00edch c\u1ee7a m\u00ecnh ho\u1eb7c th\u00eam logic Jinja b\u1ed5 sung, n\u1ebfu c\u1ea7n. \u0110\u1ec3 bi\u1ebft ph\u1ea7n gi\u1edbi thi\u1ec7u v\u1ec1 Jinja, h\u00e3y \u0111\u1ecdc&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/introduction-to-jinja-templates-for-salt\/\">Gi\u1edbi thi\u1ec7u v\u1ec1 M\u1eabu Jinja cho Salt<\/a>&nbsp;.<\/p>\n<p>B\u1ea1n c\u0169ng c\u00f3 th\u1ec3 ghi \u0111\u00e8 b\u1ea5t k\u1ef3 gi\u00e1 tr\u1ecb t\u1eeb \u0111i\u1ec3n n\u00e0o \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh trong t\u1ec7p&nbsp;<code>timezone\/defaults.yaml<\/code>Pillar&nbsp;<code>timezone\/osfamilymap.yaml<\/code>b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng quy \u01b0\u1edbc t\u1eeb \u0111i\u1ec3n tra c\u1ee9u c\u1ee7a Salt. V\u00ed d\u1ee5, n\u1ebfu b\u1ea1n mu\u1ed1n ghi \u0111\u00e8&nbsp;<code>pkgname<\/code>gi\u00e1 tr\u1ecb \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh trong&nbsp;<code>timezone\/defaults.yaml<\/code>t\u1ec7p Pillar c\u1ee7a m\u00ecnh, v\u00ed d\u1ee5 sau c\u00f3 th\u1ec3 tr\u00f4ng gi\u1ed1ng nh\u01b0 sau:<\/p>\n<pre class=\"wp-block-code\"><code>timezone:\n  lookup:\n    {%- if grains&#91;'os_family'] == 'Debian' %}\n    name: America\/New_York\n    {%- else %}\n    name: 'Europe\/Berlin'\n    {%- endif %}\n    utc: True\n    pkgname: timezone\n    <\/code><\/pre>\n<p>3.N\u1ebfu b\u1ea1n \u0111\u00e3 sao ch\u00e9p timezone-formula v\u00e0o m\u00e1y ch\u1ee7 ch\u00ednh thay v\u00ec th\u00eam c\u00f4ng th\u1ee9c d\u01b0\u1edbi d\u1ea1ng GitFS t\u1eeb xa, h\u00e3y th\u00eam th\u01b0 m\u1ee5c timezone-formula v\u00e0o&nbsp;<code>file_roots<\/code>c\u1ea5u h\u00ecnh c\u1ee7a m\u00e1y ch\u1ee7 ch\u00ednh Salt:<\/p>\n<pre class=\"wp-block-code\"><code>file_roots:\n  base:\n    - \/srv\/salt\/\n    - \/srv\/formulas\/timezone-formula\n    <\/code><\/pre>\n<p>4.Th\u00eam Pillar v\u00e0o t\u1ec7p tr\u00ean c\u00f9ng c\u1ee7a Pillar:<\/p>\n<pre class=\"wp-block-code\"><code>base:\n  '*':\n    - timezone\n<\/code><\/pre>\n<p>5.C\u1ea5u h\u00ecnh v\u1ecb tr\u00ed c\u1ee7a t\u1ec7p Pillar:<\/p>\n<pre class=\"wp-block-code\"><code>pillar_roots:\n  base:\n    - \/srv\/pillar\n    <\/code><\/pre>\n<p>6.Kh\u1edfi \u0111\u1ed9ng l\u1ea1i Salt master \u0111\u1ec3 c\u1ea5u h\u00ecnh m\u1edbi c\u00f3 hi\u1ec7u l\u1ef1c tr\u00ean Salt master:<\/p>\n<pre class=\"wp-block-code\"><code>sudo systemctl restart salt-master\n<\/code><\/pre>\n<p>7.Ch\u1ea1y l\u1ec7nh highstate t\u1edbi minion c\u1ee7a b\u1ea1n \u0111\u1ec3 \u00e1p d\u1ee5ng tr\u1ea1ng th\u00e1i \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh trong c\u00f4ng th\u1ee9c m\u00fai gi\u1edd:<\/p>\n<pre class=\"wp-block-code\"><code>sudo salt '*' state.apply\n<\/code><\/pre>\n<h2 id=\"next-steps\">C\u00e1c b\u01b0\u1edbc ti\u1ebfp theo<a href=\"https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/#next-steps\"><\/a><\/h2>\n<p>\u0110\u1ec3 t\u00ecm hi\u1ec3u c\u00e1ch t\u1ea1o c\u00f4ng th\u1ee9c Salt c\u1ee7a ri\u00eang b\u1ea1n v\u00e0 c\u00e1ch s\u1eafp x\u1ebfp tr\u1ea1ng th\u00e1i c\u1ee7a c\u00f4ng th\u1ee9c theo c\u00e1ch h\u1ee3p l\u00fd v\u00e0 theo m\u00f4-\u0111un, h\u00e3y \u0111\u1ecdc h\u01b0\u1edbng d\u1eabn&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/\/applications\/configuration-management\/automate-a-static-site-deployment-with-salt\/#initialize-the-salt-minion-s-formula\">T\u1ef1 \u0111\u1ed9ng tri\u1ec3n khai trang web t\u0129nh b\u1eb1ng Salt, Git v\u00e0 Webhooks<\/a>&nbsp;c\u1ee7a ch\u00fang t\u00f4i .<\/p>\n<h2 id=\"more-information\">Th\u00f4ng tin th\u00eam<\/h2>\n<p>B\u1ea1n c\u00f3 th\u1ec3 mu\u1ed1n tham kh\u1ea3o c\u00e1c ngu\u1ed3n sau \u0111\u1ec3 bi\u1ebft th\u00eam th\u00f4ng tin v\u1ec1 ch\u1ee7 \u0111\u1ec1 n\u00e0y. M\u1eb7c d\u00f9 ch\u00fang t\u00f4i cung c\u1ea5p v\u1edbi hy v\u1ecdng r\u1eb1ng ch\u00fang s\u1ebd h\u1eefu \u00edch, nh\u01b0ng xin l\u01b0u \u00fd r\u1eb1ng ch\u00fang t\u00f4i kh\u00f4ng th\u1ec3 \u0111\u1ea3m b\u1ea3o t\u00ednh ch\u00ednh x\u00e1c ho\u1eb7c t\u00ednh k\u1ecbp th\u1eddi c\u1ee7a c\u00e1c t\u00e0i li\u1ec7u \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef b\u00ean ngo\u00e0i.<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.saltproject.io\/en\/latest\/topics\/development\/conventions\/formulas.html\" target=\"_blank\" rel=\"noreferrer noopener\">C\u00f4ng th\u1ee9c mu\u1ed1i<\/a><\/li>\n<li><a href=\"https:\/\/docs.saltproject.io\/en\/latest\/topics\/tutorials\/gitfs.html\" target=\"_blank\" rel=\"noreferrer noopener\">H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng Git Fileserver Backend<\/a><\/li>\n<\/ul>\n<p>Ngu\u1ed3n: https:\/\/www.linode.com\/docs\/guides\/use-and-modify-official-saltstack-formulas\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>T\u1eadp tin tr\u1ea1ng th\u00e1i Salt&nbsp; N\u1ec1n t\u1ea3ng SaltStack bao g\u1ed3m hai th\u00e0nh ph\u1ea7n ch\u00ednh: M\u1ed9t c\u00f4ng c\u1ee5 th\u1ef1c thi t\u1eeb xa x\u1eed l\u00fd giao ti\u1ebfp hai chi\u1ec1u cho b\u1ea5t k\u1ef3 n\u00fat n\u00e0o trong c\u01a1 s\u1edf h\u1ea1 t\u1ea7ng c\u1ee7a b\u1ea1n (master v\u00e0 minion) v\u00e0 m\u1ed9t h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd c\u1ea5u h\u00ecnh duy tr\u00ec t\u1ea5t c\u1ea3 c\u00e1c<\/p>\n","protected":false},"author":1,"featured_media":36045,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[124],"tags":[],"class_list":["post-34990","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-salt"],"_links":{"self":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts\/34990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/comments?post=34990"}],"version-history":[{"count":0,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts\/34990\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/media\/36045"}],"wp:attachment":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/media?parent=34990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/categories?post=34990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/tags?post=34990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}