{"id":34919,"date":"2024-08-26T15:41:45","date_gmt":"2024-08-26T08:41:45","guid":{"rendered":"http:\/\/jupitek.maudemo.vip\/index.php\/2024\/08\/26\/use-the-linode-ansible-collection-to-deploy-a-linode\/"},"modified":"2024-08-26T15:41:45","modified_gmt":"2024-08-26T08:41:45","slug":"use-the-linode-ansible-collection-to-deploy-a-linode","status":"publish","type":"post","link":"https:\/\/jupitek.maudemo.vip\/index.php\/2024\/08\/26\/use-the-linode-ansible-collection-to-deploy-a-linode\/","title":{"rendered":"S\u1eed d\u1ee5ng Linode Ansible Collection \u0111\u1ec3 tri\u1ec3n khai Linode"},"content":{"rendered":"<p>Ansible l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 C\u01a1 s\u1edf h\u1ea1 t\u1ea7ng d\u01b0\u1edbi d\u1ea1ng M\u00e3 (IaC) m\u00e3 ngu\u1ed3n m\u1edf ph\u1ed5 bi\u1ebfn c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 ho\u00e0n th\u00e0nh c\u00e1c t\u00e1c v\u1ee5 CNTT ph\u1ed5 bi\u1ebfn nh\u01b0 cung c\u1ea5p \u0111\u00e1m m\u00e2y v\u00e0 qu\u1ea3n l\u00fd c\u1ea5u h\u00ecnh tr\u00ean nhi\u1ec1u th\u00e0nh ph\u1ea7n c\u01a1 s\u1edf h\u1ea1 t\u1ea7ng. Th\u01b0\u1eddng \u0111\u01b0\u1ee3c coi l\u00e0 gi\u1ea3i ph\u00e1p cho c\u00e1c v\u1ea5n \u0111\u1ec1 v\u1ec1 c\u1ea5u h\u00ecnh \u0111a \u0111\u00e1m m\u00e2y, t\u1ef1 \u0111\u1ed9ng h\u00f3a v\u00e0 ph\u00e2n ph\u1ed1i li\u00ean t\u1ee5c, Ansible \u0111\u01b0\u1ee3c nhi\u1ec1u ng\u01b0\u1eddi coi l\u00e0 ti\u00eau chu\u1ea9n c\u00f4ng nghi\u1ec7p trong b\u1ed1i c\u1ea3nh \u0111\u00e1m m\u00e2y hi\u1ec7n \u0111\u1ea1i.<\/p>\n<p><a href=\"https:\/\/github.com\/ansible-collections\/overview\" target=\"_blank\" rel=\"noreferrer noopener\">Ansible Collections<\/a>&nbsp;l\u00e0 ti\u00eau chu\u1ea9n m\u1edbi nh\u1ea5t \u0111\u1ec3 qu\u1ea3n l\u00fd n\u1ed9i dung Ansible, cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng c\u00e0i \u0111\u1eb7t c\u00e1c vai tr\u00f2, m\u00f4-\u0111un v\u00e0 plugin v\u1edbi \u00edt chi ph\u00ed ph\u00e1t tri\u1ec3n v\u00e0 qu\u1ea3n tr\u1ecb h\u01a1n bao gi\u1edd h\u1ebft.&nbsp;<a href=\"https:\/\/github.com\/linode\/ansible_linode\" target=\"_blank\" rel=\"noreferrer noopener\">B\u1ed9 s\u01b0u t\u1eadp Linode Ansible<\/a>&nbsp;cung c\u1ea5p c\u00e1c plugin c\u01a1 b\u1ea3n c\u1ea7n thi\u1ebft \u0111\u1ec3 b\u1eaft \u0111\u1ea7u s\u1eed d\u1ee5ng d\u1ecbch v\u1ee5 Linode v\u1edbi Ansible ngay l\u1eadp t\u1ee9c.<\/p>\n<p>H\u01b0\u1edbng d\u1eabn n\u00e0y ch\u1ec9 c\u00e1ch th\u1ef1c hi\u1ec7n:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#install-the-linode-ansible-collection\">C\u00e0i \u0111\u1eb7t b\u1ed9 s\u01b0u t\u1eadp Linode Ansible<\/a>&nbsp;b\u1eb1ng kho l\u01b0u tr\u1eef c\u00f4ng khai c\u1ee7a Ansible cho c\u00e1c d\u1ef1 \u00e1n c\u1ed9ng \u0111\u1ed3ng<\/li>\n<li><a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#configure-ansible\">C\u1ea5u h\u00ecnh Ansible v\u00e0 m\u00e3 h\u00f3a th\u00f4ng tin nh\u1ea1y c\u1ea3m b\u1eb1ng Ansible Vault<\/a><\/li>\n<li><a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#understanding-fully-qualified-collection-namespaces\">Hi\u1ec3u v\u1ec1 kh\u00f4ng gian t\u00ean b\u1ed9 s\u01b0u t\u1eadp \u0111\u1ee7 \u0111i\u1ec1u ki\u1ec7n c\u1ee7a Ansible<\/a><\/li>\n<li><a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#deploy-a-linode-with-the-linode-ansible-collection\">Tri\u1ec3n khai phi\u00ean b\u1ea3n Linode<\/a>&nbsp;b\u1eb1ng Ansible v\u00e0 b\u1ed9 s\u01b0u t\u1eadp Linode Ansible.<\/li>\n<\/ul>\n<p class=\"has-background\" style=\"background-color:#f32a2a33\">Quan tr\u1ecdng: H\u01b0\u1edbng d\u1eabn m\u1eabu c\u1ee7a h\u01b0\u1edbng d\u1eabn n\u00e0y t\u1ea1o m\u1ed9t t\u00e0i nguy\u00ean c\u00f3 th\u1ec3 thanh to\u00e1n&nbsp;<a href=\"https:\/\/www.linode.com\/pricing\/#compute-shared\" target=\"_blank\" rel=\"noreferrer noopener\">Linode (Nanode) 1GB<\/a>&nbsp;tr\u00ean t\u00e0i kho\u1ea3n Linode c\u1ee7a b\u1ea1n. N\u1ebfu b\u1ea1n kh\u00f4ng mu\u1ed1n ti\u1ebfp t\u1ee5c s\u1eed d\u1ee5ng Linode m\u00e0 b\u1ea1n t\u1ea1o, h\u00e3y \u0111\u1ea3m b\u1ea3o x\u00f3a Linode khi b\u1ea1n ho\u00e0n th\u00e0nh h\u01b0\u1edbng d\u1eabn.N\u1ebfu b\u1ea1n x\u00f3a t\u00e0i nguy\u00ean,&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/understanding-billing-and-payments\/\">b\u1ea1n s\u1ebd ch\u1ec9 b\u1ecb t\u00ednh ph\u00ed cho s\u1ed1 gi\u1edd m\u00e0 t\u00e0i nguy\u00ean \u0111\u00f3 c\u00f3 trong t\u00e0i kho\u1ea3n c\u1ee7a b\u1ea1n<\/a>&nbsp;.<\/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\/deploy-linodes-using-linode-ansible-collection\/#before-you-begin\"><\/a><\/h2>\n<p class=\"has-background\" style=\"background-color:#74f78c33\">Ghi ch\u00fa: C\u00e1c b\u01b0\u1edbc \u0111\u01b0\u1ee3c n\u00eau trong h\u01b0\u1edbng d\u1eabn n\u00e0y y\u00eau c\u1ea7u&nbsp;<a href=\"https:\/\/github.com\/ansible\/ansible\/releases\/tag\/v2.9.10\" target=\"_blank\" rel=\"noreferrer noopener\">Ansible phi\u00ean b\u1ea3n 2.9.10 tr\u1edf l\u00ean<\/a>&nbsp;v\u00e0 \u0111\u00e3 \u0111\u01b0\u1ee3c th\u1eed nghi\u1ec7m tr\u00ean Linode ch\u1ea1y Ubuntu 22.04. C\u00e1c h\u01b0\u1edbng d\u1eabn c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c \u0111i\u1ec1u ch\u1ec9nh cho c\u00e1c b\u1ea3n ph\u00e2n ph\u1ed1i Linux ho\u1eb7c h\u1ec7 \u0111i\u1ec1u h\u00e0nh kh\u00e1c.<\/p>\n<p>1.Cung c\u1ea5p m\u1ed9t m\u00e1y ch\u1ee7 ho\u1ea1t \u0111\u1ed9ng nh\u01b0&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/getting-started-with-ansible\/#what-is-ansible\"><em>n\u00fat \u0111i\u1ec1u khi\u1ec3n<\/em><\/a>&nbsp;Ansible , t\u1eeb \u0111\u00f3 c\u00e1c phi\u00ean b\u1ea3n t\u00ednh to\u00e1n kh\u00e1c \u0111\u01b0\u1ee3c tri\u1ec3n khai. L\u00e0m theo h\u01b0\u1edbng d\u1eabn trong h\u01b0\u1edbng d\u1eabn&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/products\/compute\/compute-instances\/guides\/create\/\">T\u1ea1o phi\u00ean b\u1ea3n t\u00ednh to\u00e1n<\/a>&nbsp;c\u1ee7a ch\u00fang t\u00f4i \u0111\u1ec3 t\u1ea1o Linode ch\u1ea1y Ubuntu 22.04. M\u1ed9t CPU d\u00f9ng chung 1GB Nanode l\u00e0 ph\u00f9 h\u1ee3p. B\u1ea1n c\u0169ng c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng m\u00e1y tr\u1ea1m ho\u1eb7c m\u00e1y t\u00ednh x\u00e1ch tay hi\u1ec7n c\u00f3 n\u1ebfu b\u1ea1n th\u00edch.<\/p>\n<p>2.Th\u00eam ng\u01b0\u1eddi d\u00f9ng Linux gi\u1edbi h\u1ea1n v\u00e0o n\u00fat \u0111i\u1ec1u khi\u1ec3n Linode c\u1ee7a b\u1ea1n b\u1eb1ng c\u00e1ch l\u00e0m theo ph\u1ea7n&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/products\/compute\/compute-instances\/guides\/set-up-and-secure\/#add-a-limited-user-account\">Th\u00eam t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng gi\u1edbi h\u1ea1n<\/a>&nbsp;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 t\u00ednh to\u00e1n<\/a>&nbsp;c\u1ee7a ch\u00fang t\u00f4i . \u0110\u1ea3m b\u1ea3o r\u1eb1ng t\u1ea5t c\u1ea3 c\u00e1c l\u1ec7nh cho ph\u1ea7n c\u00f2n l\u1ea1i c\u1ee7a h\u01b0\u1edbng d\u1eabn n\u00e0y \u0111\u01b0\u1ee3c nh\u1eadp d\u01b0\u1edbi d\u1ea1ng ng\u01b0\u1eddi d\u00f9ng gi\u1edbi h\u1ea1n c\u1ee7a b\u1ea1n.<\/p>\n<p>3.\u0110\u1ea3m b\u1ea3o r\u1eb1ng b\u1ea1n \u0111\u00e3 th\u1ef1c hi\u1ec7n c\u1eadp nh\u1eadt h\u1ec7 th\u1ed1ng:<\/p>\n<pre class=\"wp-block-code\"><code><code>sudo apt update &amp;&amp; sudo apt upgrade<\/code><\/code><\/pre>\n<p>4.C\u00e0i \u0111\u1eb7t Ansible tr\u00ean n\u00fat \u0111i\u1ec1u khi\u1ec3n c\u1ee7a b\u1ea1n. L\u00e0m theo c\u00e1c b\u01b0\u1edbc trong ph\u1ea7n&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/getting-started-with-ansible\/#install-ansible\">C\u00e0i \u0111\u1eb7t Ansible<\/a>&nbsp;c\u1ee7a h\u01b0\u1edbng d\u1eabn&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/getting-started-with-ansible\/\">B\u1eaft \u0111\u1ea7u v\u1edbi Ansible &#8211; C\u00e0i \u0111\u1eb7t v\u00e0 thi\u1ebft l\u1eadp c\u01a1 b\u1ea3n<\/a>&nbsp;.<\/p>\n<p>5.\u0110\u1ea3m b\u1ea3o b\u1ea1n \u0111\u00e3 c\u00e0i \u0111\u1eb7t Python phi\u00ean b\u1ea3n 2.7 tr\u1edf l\u00ean tr\u00ean n\u00fat \u0111i\u1ec1u khi\u1ec3n c\u1ee7a m\u00ecnh. Ph\u00e1t h\u00e0nh l\u1ec7nh sau \u0111\u1ec3 ki\u1ec3m tra phi\u00ean b\u1ea3n Python c\u1ee7a h\u1ec7 th\u1ed1ng:<\/p>\n<pre class=\"wp-block-code\"><code><code>python --version<\/code><\/code><\/pre>\n<p>Nhi\u1ec1u h\u1ec7 \u0111i\u1ec1u h\u00e0nh, bao g\u1ed3m Ubuntu 22.04, thay v\u00e0o \u0111\u00f3 c\u00e0i \u0111\u1eb7t Python 3 theo m\u1eb7c \u0111\u1ecbnh. Tr\u00ecnh th\u00f4ng d\u1ecbch Python 3 th\u01b0\u1eddng c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c g\u1ecdi b\u1eb1ng l\u1ec7nh&nbsp;<code>python3<\/code>v\u00e0 ph\u1ea7n c\u00f2n l\u1ea1i c\u1ee7a h\u01b0\u1edbng d\u1eabn n\u00e0y gi\u1ea3 \u0111\u1ecbnh Python 3 \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t v\u00e0 s\u1eed d\u1ee5ng. V\u00ed d\u1ee5: b\u1ea1n c\u00f3 th\u1ec3 ch\u1ea1y l\u1ec7nh n\u00e0y \u0111\u1ec3 ki\u1ec3m tra phi\u00ean b\u1ea3n Python 3 c\u1ee7a m\u00ecnh:<\/p>\n<pre class=\"wp-block-code\"><code><code>python3 --version<\/code><\/code><\/pre>\n<p>6.C\u00e0i \u0111\u1eb7t tr\u00ecnh qu\u1ea3n l\u00fd g\u00f3i pip:<\/p>\n<pre class=\"wp-block-code\"><code><code>sudo apt install python3-pip<\/code><\/code><\/pre>\n<p>7.T\u1ea1o m\u00e3 th\u00f4ng b\u00e1o truy c\u1eadp Linode API v4 c\u00f3 quy\u1ec1n \u0111\u1ecdc v\u00e0 ghi Linodes v\u00e0 ghi l\u1ea1i m\u00e3 th\u00f4ng b\u00e1o n\u00e0y trong tr\u00ecnh qu\u1ea3n l\u00fd m\u1eadt kh\u1ea9u ho\u1eb7c v\u1ecb tr\u00ed an to\u00e0n kh\u00e1c. Th\u1ef1c hi\u1ec7n theo ph\u1ea7n&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/products\/tools\/api\/get-started\/#get-an-access-token\">Nh\u1eadn m\u00e3 th\u00f4ng b\u00e1o truy c\u1eadp<\/a>&nbsp;trong h\u01b0\u1edbng d\u1eabn&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/products\/tools\/api\/get-started\/\">B\u1eaft \u0111\u1ea7u v\u1edbi Linode API<\/a>&nbsp;.<\/p>\n<h2 id=\"install-the-linode-ansible-collection\">C\u00e0i \u0111\u1eb7t Linode Ansible Collection<a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#install-the-linode-ansible-collection\"><\/a><\/h2>\n<p>B\u1ed9 s\u01b0u t\u1eadp Linode Ansible hi\u1ec7n l\u00e0 m\u00e3 ngu\u1ed3n m\u1edf v\u00e0 \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef tr\u00ean c\u1ea3&nbsp;<a href=\"https:\/\/github.com\/linode\/ansible_linode\" target=\"_blank\" rel=\"noreferrer noopener\">kho l\u01b0u tr\u1eef Github c\u00f4ng khai<\/a>&nbsp;v\u00e0 tr\u00ean&nbsp;<a href=\"https:\/\/galaxy.ansible.com\/linode\/cloud\" target=\"_blank\" rel=\"noreferrer noopener\">Ansible Galaxy<\/a>&nbsp;. Ansible Galaxy l\u00e0 kho l\u01b0u tr\u1eef t\u1eadp trung v\u00e0o c\u1ed9ng \u0111\u1ed3ng c\u1ee7a ri\u00eang Ansible, cung c\u1ea5p th\u00f4ng tin v\u00e0 quy\u1ec1n truy c\u1eadp v\u00e0o nhi\u1ec1u&nbsp;<a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/galaxy\/user_guide.html#finding-collections-on-galaxy\" target=\"_blank\" rel=\"noreferrer noopener\">b\u1ed9 s\u01b0u t\u1eadp Ansible<\/a>&nbsp;v\u00e0&nbsp;<a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/user_guide\/playbooks_reuse_roles.html\" target=\"_blank\" rel=\"noreferrer noopener\">vai tr\u00f2 Ansible<\/a>&nbsp;. H\u1ed7 tr\u1ee3 Ansible Galaxy \u0111\u01b0\u1ee3c t\u00edch h\u1ee3p v\u00e0o c\u00e1c phi\u00ean b\u1ea3n m\u1edbi nh\u1ea5t c\u1ee7a Ansible theo m\u1eb7c \u0111\u1ecbnh. Trong khi ng\u01b0\u1eddi d\u00f9ng c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t b\u1ed9 s\u01b0u t\u1eadp Linode Ansible&nbsp;<a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/galaxy\/user_guide.html#installing-a-collection-from-source-files\" target=\"_blank\" rel=\"noreferrer noopener\">t\u1eeb ngu\u1ed3n<\/a>&nbsp;ho\u1eb7c b\u1eb1ng&nbsp;<a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/galaxy\/user_guide.html#installing-a-collection-from-a-git-repository\" target=\"_blank\" rel=\"noreferrer noopener\">c\u00e1ch s\u1eed d\u1ee5ng git<\/a>&nbsp;, c\u00e1c b\u01b0\u1edbc sau \u0111\u00e2y s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1ch s\u1eed d\u1ee5ng Ansible Galaxy:<\/p>\n<p>1.C\u00e0i \u0111\u1eb7t c\u00e1c ph\u1ee5 thu\u1ed9c c\u1ea7n thi\u1ebft cho Ansible:<\/p>\n<pre class=\"wp-block-code\"><code><code>sudo -H pip3 install -Iv 'resolvelib&lt;0.6.0'<\/code><\/code><\/pre>\n<p>2.T\u1ea3i xu\u1ed1ng phi\u00ean b\u1ea3n m\u1edbi nh\u1ea5t c\u1ee7a b\u1ed9 s\u01b0u t\u1eadp Linode Ansible b\u1eb1ng l\u1ec7nh&nbsp;<code>ansible-galaxy<\/code>:<\/p>\n<pre class=\"wp-block-code\"><code><code>ansible-galaxy collection install linode.cloud <\/code><\/code><\/pre>\n<p>Sau khi b\u1ed9 s\u01b0u t\u1eadp \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t, t\u1ea5t c\u1ea3 c\u00e1c t\u1ec7p c\u1ea5u h\u00ecnh s\u1ebd \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef trong&nbsp;<code>~\/.ansible\/collections\/ansible_collections\/<\/code>th\u01b0 m\u1ee5c b\u1ed9 s\u01b0u t\u1eadp m\u1eb7c \u0111\u1ecbnh.<\/p>\n<p>3.C\u00e0i \u0111\u1eb7t c\u00e1c ph\u1ee5 thu\u1ed9c m\u00f4-\u0111un Python c\u1ea7n thi\u1ebft cho b\u1ed9 s\u01b0u t\u1eadp Linode Ansible. Th\u01b0 m\u1ee5c c\u00e0i \u0111\u1eb7t b\u1ed9 s\u01b0u t\u1eadp Linode ch\u1ee9a m\u1ed9t&nbsp;<code>requirements.txt<\/code>t\u1ec7p li\u1ec7t k\u00ea c\u00e1c ph\u1ee5 thu\u1ed9c Python, bao g\u1ed3m&nbsp;<a href=\"https:\/\/github.com\/linode\/linode_api4-python\" target=\"_blank\" rel=\"noreferrer noopener\">th\u01b0 vi\u1ec7n Python ch\u00ednh th\u1ee9c cho Linode API v4<\/a>&nbsp;. S\u1eed d\u1ee5ng pip \u0111\u1ec3 c\u00e0i \u0111\u1eb7t c\u00e1c ph\u1ee5 thu\u1ed9c n\u00e0y:<\/p>\n<pre class=\"wp-block-code\"><code><code>sudo pip3 install -r .ansible\/collections\/ansible_collections\/linode\/cloud\/requirements.txt<\/code><\/code><\/pre>\n<p>B\u1ed9 s\u01b0u t\u1eadp Linode Ansible hi\u1ec7n \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t v\u00e0 s\u1eb5n s\u00e0ng \u0111\u1ec3 tri\u1ec3n khai v\u00e0 qu\u1ea3n l\u00fd c\u00e1c d\u1ecbch v\u1ee5 Linode.<\/p>\n<h2 id=\"configure-ansible\">C\u1ea5u h\u00ecnh Ansible<a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#configure-ansible\"><\/a><\/h2>\n<p>Khi giao ti\u1ebfp v\u1edbi b\u1ed9 s\u01b0u t\u1eadp Linode Ansible, th\u00f4ng th\u01b0\u1eddng n\u00ean s\u1eed d\u1ee5ng c\u00e1c bi\u1ebfn \u0111\u1ec3 l\u01b0u tr\u1eef an to\u00e0n c\u00e1c chu\u1ed7i nh\u1ea1y c\u1ea3m nh\u01b0 m\u00e3 th\u00f4ng b\u00e1o API. Ph\u1ea7n n\u00e0y s\u1ebd h\u01b0\u1edbng d\u1eabn c\u00e1ch l\u01b0u tr\u1eef v\u00e0 truy c\u1eadp an to\u00e0n m\u00e3 th\u00f4ng&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/products\/platform\/accounts\/guides\/manage-api-tokens\/\">b\u00e1o Truy c\u1eadp API Linode<\/a>&nbsp;(\u0111\u01b0\u1ee3c t\u1ea1o trong ph\u1ea7n&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#before-you-begin\">Tr\u01b0\u1edbc khi b\u1eaft \u0111\u1ea7u<\/a>&nbsp;) c\u00f9ng v\u1edbi m\u1eadt kh\u1ea9u g\u1ed1c \u0111\u01b0\u1ee3c g\u00e1n cho c\u00e1c phi\u00ean b\u1ea3n Linode m\u1edbi. C\u1ea3 hai \u0111\u1ec1u \u0111\u01b0\u1ee3c m\u00e3 h\u00f3a b\u1eb1ng&nbsp;<a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/user_guide\/vault.html\" target=\"_blank\" rel=\"noreferrer noopener\">Ansible Vault<\/a>&nbsp;.<\/p>\n<h3 id=\"create-an-ansible-vault-password-file\">T\u1ea1o m\u1ed9t t\u1ec7p m\u1eadt kh\u1ea9u Ansible Vault<a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#create-an-ansible-vault-password-file\"><\/a><\/h3>\n<p>1.T\u1eeb th\u01b0 m\u1ee5c home c\u1ee7a n\u00fat \u0111i\u1ec1u khi\u1ec3n, t\u1ea1o m\u1ed9t th\u01b0 m\u1ee5c ph\u00e1t tri\u1ec3n \u0111\u1ec3 l\u01b0u tr\u1eef c\u00e1c t\u1ec7p Ansible do ng\u01b0\u1eddi d\u00f9ng t\u1ea1o. Sau \u0111\u00f3 \u0111i\u1ec1u h\u01b0\u1edbng \u0111\u1ebfn th\u01b0 m\u1ee5c m\u1edbi n\u00e0y:<\/p>\n<pre class=\"wp-block-code\"><code><code>mkdir development &amp;&amp; cd development<\/code><\/code><\/pre>\n<p>2.Trong&nbsp;<code>development<\/code>th\u01b0 m\u1ee5c, t\u1ea1o m\u1ed9t t\u1ec7p v\u0103n b\u1ea3n tr\u1ed1ng m\u1edbi c\u00f3 t\u00ean l\u00e0&nbsp;<code>.vault-pass<\/code>(kh\u00f4ng c\u00f3 ph\u1ea7n m\u1edf r\u1ed9ng t\u1ec7p). Sau \u0111\u00f3 t\u1ea1o m\u1ed9t m\u1eadt kh\u1ea9u m\u1edbi ph\u1ee9c t\u1ea1p, duy nh\u1ea5t (v\u00ed d\u1ee5, b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng tr\u00ecnh qu\u1ea3n l\u00fd m\u1eadt kh\u1ea9u), sao ch\u00e9p m\u1eadt kh\u1ea9u \u0111\u00f3 v\u00e0o t\u1ec7p m\u1edbi v\u00e0 l\u01b0u. M\u1eadt kh\u1ea9u n\u00e0y \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 m\u00e3 h\u00f3a v\u00e0 gi\u1ea3i m\u00e3 th\u00f4ng tin \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef b\u1eb1ng Ansible Vault:<\/p>\n<pre class=\"wp-block-code\"><code>&lt;PasteYourAnsibleVaultPasswordHere&gt;<\/code><\/pre>\n<p>\u0110\u00e2y l\u00e0&nbsp;<em>t\u1ec7p m\u1eadt kh\u1ea9u<\/em>&nbsp;Ansible Vault . T\u1ec7p m\u1eadt kh\u1ea9u cung c\u1ea5p m\u1eadt kh\u1ea9u Vault c\u1ee7a b\u1ea1n cho c\u00e1c l\u1ec7nh m\u00e3 h\u00f3a c\u1ee7a Ansible Vault. Ansible Vault c\u0169ng cung c\u1ea5p c\u00e1c t\u00f9y ch\u1ecdn kh\u00e1c \u0111\u1ec3 qu\u1ea3n l\u00fd m\u1eadt kh\u1ea9u. \u0110\u1ec3 t\u00ecm hi\u1ec3u th\u00eam v\u1ec1 qu\u1ea3n l\u00fd m\u1eadt kh\u1ea9u, h\u00e3y \u0111\u1ecdc t\u00e0i li\u1ec7u&nbsp;<a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/user_guide\/vault.html#providing-vault-passwords\" target=\"_blank\" rel=\"noreferrer noopener\">Cung c\u1ea5p m\u1eadt kh\u1ea9u Vault<\/a>&nbsp;c\u1ee7a Ansible .<\/p>\n<p>3.\u0110\u1eb7t quy\u1ec1n cho t\u1ec7p \u0111\u1ec3 ch\u1ec9 ng\u01b0\u1eddi d\u00f9ng c\u1ee7a b\u1ea1n m\u1edbi c\u00f3 th\u1ec3 \u0111\u1ecdc v\u00e0 ghi v\u00e0o t\u1ec7p:<\/p>\n<pre class=\"wp-block-code\"><code>chmod 600 .vault-pass\n<\/code><\/pre>\n<h3 id=\"create-an-ansible-configuration-file\">T\u1ea1o m\u1ed9t t\u1ec7p c\u1ea5u h\u00ecnh Ansible<a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#create-an-ansible-configuration-file\"><\/a><\/h3>\n<p>T\u1ea1o m\u1ed9t t\u1ec7p c\u1ea5u h\u00ecnh Ansible \u0111\u01b0\u1ee3c g\u1ecdi&nbsp;<code>ansible.cfg<\/code>b\u1eb1ng tr\u00ecnh so\u1ea1n th\u1ea3o v\u0103n b\u1ea3n b\u1ea1n ch\u1ecdn. Sao ch\u00e9p \u0111o\u1ea1n m\u00e3 n\u00e0y v\u00e0o t\u1ec7p:T\u1eadp tin: ~\/development\/ansible.cfg<\/p>\n<pre class=\"wp-block-code\"><code>&#91;defaults]\nVAULT_PASSWORD_FILE = .\/.vault-pass<\/code><\/pre>\n<p>Nh\u1eefng d\u00f2ng n\u00e0y ch\u1ec9 \u0111\u1ecbnh v\u1ecb tr\u00ed t\u1ec7p m\u1eadt kh\u1ea9u c\u1ee7a b\u1ea1n.<\/p>\n<h3 id=\"encrypt-variables-with-ansible-vault\">M\u00e3 h\u00f3a c\u00e1c bi\u1ebfn v\u1edbi Ansible Vault<a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#encrypt-variables-with-ansible-vault\"><\/a><\/h3>\n<p>1.T\u1ea1o m\u1ed9t th\u01b0 m\u1ee5c \u0111\u1ec3 l\u01b0u tr\u1eef c\u00e1c t\u1ec7p bi\u1ebfn \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng v\u1edbi&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/getting-started-with-ansible\/#what-is-ansible\">s\u1ed5 tay h\u01b0\u1edbng d\u1eabn Ansible<\/a>&nbsp;c\u1ee7a b\u1ea1n :<\/p>\n<pre class=\"wp-block-code\"><code><code>mkdir -p ~\/development\/group_vars\/<\/code><\/code><\/pre>\n<p>2.T\u1ea1o m\u1ed9t t\u1ec7p v\u0103n b\u1ea3n tr\u1ed1ng m\u1edbi c\u00f3 t\u00ean&nbsp;<code>vars.yml<\/code>trong th\u01b0 m\u1ee5c n\u00e0y. Trong c\u00e1c b\u01b0\u1edbc ti\u1ebfp theo, m\u00e3 th\u00f4ng b\u00e1o API \u0111\u01b0\u1ee3c m\u00e3 h\u00f3a v\u00e0 m\u1eadt kh\u1ea9u g\u1ed1c c\u1ee7a b\u1ea1n \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef trong t\u1ec7p n\u00e0y:<\/p>\n<pre class=\"wp-block-code\"><code><code>touch ~\/development\/group_vars\/vars.yml<\/code><\/code><\/pre>\n<p>3.T\u1ea1o m\u1eadt kh\u1ea9u m\u1edbi ph\u1ee9c t\u1ea1p, duy nh\u1ea5t (v\u00ed d\u1ee5: b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng tr\u00ecnh qu\u1ea3n l\u00fd m\u1eadt kh\u1ea9u) s\u1ebd \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng l\u00e0m m\u1eadt kh\u1ea9u g\u1ed1c cho c\u00e1c phi\u00ean b\u1ea3n t\u00ednh to\u00e1n m\u1edbi \u0111\u01b0\u1ee3c t\u1ea1o b\u1eb1ng b\u1ed9 s\u01b0u t\u1eadp Linode Ansible. M\u1eadt kh\u1ea9u n\u00e0y ph\u1ea3i kh\u00e1c v\u1edbi m\u1eadt kh\u1ea9u Ansible Vault \u0111\u01b0\u1ee3c ch\u1ec9 \u0111\u1ecbnh trong t\u1ec7p&nbsp;<code>.vault-pass<\/code>.<\/p>\n<p>4.S\u1eed d\u1ee5ng l\u1ec7nh sau&nbsp;<code>ansible-vault encrypt_string<\/code>\u0111\u1ec3 m\u00e3 h\u00f3a m\u1eadt kh\u1ea9u root m\u1edbi, thay th\u1ebf&nbsp;<code>MySecureRootPassword<\/code>b\u1eb1ng m\u1eadt kh\u1ea9u c\u1ee7a b\u1ea1n. V\u00ec l\u1ec7nh n\u00e0y \u0111\u01b0\u1ee3c ch\u1ea1y t\u1eeb b\u00ean trong&nbsp;<code>~\/development<\/code>th\u01b0 m\u1ee5c c\u1ee7a b\u1ea1n, n\u00ean m\u1eadt kh\u1ea9u Ansible Vault trong&nbsp;<code>.vault-pass<\/code>t\u1ec7p c\u1ee7a b\u1ea1n \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 th\u1ef1c hi\u1ec7n m\u00e3 h\u00f3a:<\/p>\n<pre class=\"wp-block-code\"><code>ansible-vault encrypt_string 'MySecureRootPassword' --name 'password' | tee -a group_vars\/vars.yml\n<\/code><\/pre>\n<p>Trong l\u1ec7nh tr\u00ean,&nbsp;<code>tee -a group_vars\/vars.yml<\/code>th\u00eam chu\u1ed7i \u0111\u01b0\u1ee3c m\u00e3 h\u00f3a v\u00e0o&nbsp;<code>vars.yml<\/code>t\u1ec7p c\u1ee7a b\u1ea1n. Sau khi ho\u00e0n t\u1ea5t, \u0111\u1ea7u ra t\u01b0\u01a1ng t\u1ef1 nh\u01b0 sau s\u1ebd xu\u1ea5t hi\u1ec7n:<\/p>\n<pre class=\"wp-block-code\"><code>password: !vault |\n    $ANSIBLE_VAULT;1.1;AES256\n    30376134633639613832373335313062366536313334316465303462656664333064373933393831\n    3432313261613532346134633761316363363535326333360a626431376265373133653535373238\n    38323166666665376366663964343830633462623537623065356364343831316439396462343935\n    6233646239363434380a383433643763373066633535366137346638613261353064353466303734\n    3833<\/code><\/pre>\n<p>5.Ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 th\u00eam d\u00f2ng m\u1edbi v\u00e0o cu\u1ed1i&nbsp;<code>vars.yml<\/code>t\u1ec7p c\u1ee7a b\u1ea1n:<\/p>\n<pre class=\"wp-block-code\"><code>echo \"\" &gt;&gt; group_vars\/vars.yml\n<\/code><\/pre>\n<p>6.S\u1eed d\u1ee5ng l\u1ec7nh sau&nbsp;<code>ansible-vault encrypt_string<\/code>\u0111\u1ec3 m\u00e3 h\u00f3a m\u00e3 th\u00f4ng b\u00e1o API Linode v\u00e0 th\u00eam n\u00f3 v\u00e0o&nbsp;<code>vars.yml<\/code>t\u1ec7p c\u1ee7a b\u1ea1n, thay th\u1ebf&nbsp;<code>MyAPIToken<\/code>b\u1eb1ng m\u00e3 th\u00f4ng b\u00e1o truy c\u1eadp c\u1ee7a ri\u00eang b\u1ea1n:<\/p>\n<pre class=\"wp-block-code\"><code>ansible-vault encrypt_string 'MyAPIToken' --name 'api-token' | tee -a group_vars\/vars.yml<\/code><\/pre>\n<p>7.Ch\u1ea1y l\u1ec7nh sau \u0111\u1ec3 th\u00eam m\u1ed9t d\u00f2ng m\u1edbi v\u00e0o cu\u1ed1i&nbsp;<code>vars.yml<\/code>t\u1ec7p c\u1ee7a b\u1ea1n:<\/p>\n<pre class=\"wp-block-code\"><code>echo \"\" &gt;&gt; group_vars\/vars.yml\n<\/code><\/pre>\n<p><code>vars.yml<\/code>T\u1ec7p&nbsp;c\u1ee7a b\u1ea1n b\u00e2y gi\u1edd s\u1ebd tr\u00f4ng gi\u1ed1ng nh\u01b0 sau:<\/p>\n<pre class=\"wp-block-code\"><code>password: !vault |\n          $ANSIBLE_VAULT;1.1;AES256\n          30376134633639613832373335313062366536313334316465303462656664333064373933393831\n          3432313261613532346134633761316363363535326333360a626431376265373133653535373238\n          38323166666665376366663964343830633462623537623065356364343831316439396462343935\n          6233646239363434380a383433643763373066633535366137346638613261353064353466303734\n          3833\ntoken: !vault |\n          $ANSIBLE_VAULT;1.1;AES256\n          65363565316233613963653465613661316134333164623962643834383632646439306566623061\n          3938393939373039373135663239633162336530373738300a316661373731623538306164363434\n          31656434356431353734666633656534343237333662613036653137396235353833313430626534\n          3330323437653835660a303865636365303532373864613632323930343265343665393432326231\n          61313635653463333630636631336539643430326662373137303166303739616262643338373834\n          34613532353031333731336339396233623533326130376431346462633832353432316163373833\n          35316333626530643736636332323161353139306533633961376432623161626132353933373661\n          36663135323664663130<\/code><\/pre>\n<h2 id=\"understanding-fully-qualified-collection-namespaces\">Hi\u1ec3u v\u1ec1 kh\u00f4ng gian t\u00ean b\u1ed9 s\u01b0u t\u1eadp \u0111\u1ee7 \u0111i\u1ec1u ki\u1ec7n<a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#understanding-fully-qualified-collection-namespaces\"><\/a><\/h2>\n<p>Ansible hi\u1ec7n \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh v\u00e0 b\u1ed9 s\u01b0u t\u1eadp Linode Ansible \u0111\u00e3 \u0111\u01b0\u1ee3c c\u00e0i \u0111\u1eb7t. B\u1ea1n c\u00f3 th\u1ec3 t\u1ea1o&nbsp;<a href=\"https:\/\/www.linode.com\/docs\/guides\/running-ansible-playbooks\/#playbook-basics\">s\u1ed5 tay h\u01b0\u1edbng d\u1eabn<\/a>&nbsp;\u0111\u1ec3 t\u1eadn d\u1ee5ng b\u1ed9 s\u01b0u t\u1eadp v\u00e0 t\u1ea1o c\u00e1c phi\u00ean b\u1ea3n t\u00ednh to\u00e1n v\u00e0 c\u00e1c t\u00e0i nguy\u00ean Linode kh\u00e1c.<\/p>\n<p>Trong s\u1ed5 tay h\u01b0\u1edbng d\u1eabn, b\u1ed9 s\u01b0u t\u1eadp Linode Ansible \u0111\u01b0\u1ee3c chia nh\u1ecf h\u01a1n n\u1eefa theo c\u00e1c lo\u1ea1i t\u00e0i nguy\u00ean th\u00f4ng qua&nbsp;<a href=\"https:\/\/github.com\/ansible-collections\/overview#terminology\" target=\"_blank\" rel=\"noreferrer noopener\">T\u00ean b\u1ed9 s\u01b0u t\u1eadp \u0111\u1ee7 \u0111i\u1ec1u ki\u1ec7n<\/a>&nbsp;(FQCN) li\u00ean k\u1ebft v\u1edbi t\u00e0i nguy\u00ean mong mu\u1ed1n. C\u00e1c t\u00ean n\u00e0y \u0111\u00f3ng vai tr\u00f2 l\u00e0 m\u00e3 \u0111\u1ecbnh danh gi\u00fap Ansible d\u1ec5 d\u00e0ng v\u00e0 c\u00f3 th\u1ea9m quy\u1ec1n h\u01a1n trong vi\u1ec7c ph\u00e2n \u0111\u1ecbnh gi\u1eefa c\u00e1c m\u00f4-\u0111un v\u00e0 plugin trong m\u1ed9t b\u1ed9 s\u01b0u t\u1eadp.<\/p>\n<h3 id=\"modules\">C\u00e1c m\u00f4-\u0111un<a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#modules\"><\/a><\/h3>\n<p>D\u01b0\u1edbi \u0111\u00e2y l\u00e0 b\u1ea3ng li\u1ec7t k\u00ea t\u1ea5t c\u1ea3 c\u00e1c FQCN hi\u1ec7n c\u00f3 trong b\u1ed9 s\u01b0u t\u1eadp Linode Ansible v\u00e0 t\u1ed5ng quan ng\u1eafn g\u1ecdn v\u1ec1 m\u1ee5c \u0111\u00edch c\u1ee7a ch\u00fang:<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>T\u00ean<\/th>\n<th>S\u1ef1 mi\u00eau t\u1ea3<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/domain.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.domain<\/a><\/td>\n<td>T\u1ea1o v\u00e0 h\u1ee7y t\u00ean mi\u1ec1n.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/domain_info.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.domain_info<\/a><\/td>\n<td>Thu th\u1eadp th\u00f4ng tin v\u1ec1 m\u1ed9t t\u00ean mi\u1ec1n hi\u1ec7n c\u00f3.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/domain_record.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.domain_record<\/a><\/td>\n<td>T\u1ea1o v\u00e0 h\u1ee7y b\u1ea3n ghi t\u00ean mi\u1ec1n.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/domain_record_info.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.domain_record_info<\/a><\/td>\n<td>Thu th\u1eadp th\u00f4ng tin v\u1ec1 b\u1ea3n ghi t\u00ean mi\u1ec1n hi\u1ec7n c\u00f3.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/firewall.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.firewall<\/a><\/td>\n<td>T\u1ea1o v\u00e0 ph\u00e1 h\u1ee7y T\u01b0\u1eddng l\u1eeda.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/firewall_info.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.firewall_info<\/a><\/td>\n<td>Thu th\u1eadp th\u00f4ng tin v\u1ec1 T\u01b0\u1eddng l\u1eeda hi\u1ec7n c\u00f3.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/firewall_device.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.firewall_device<\/a><\/td>\n<td>Qu\u1ea3n l\u00fd thi\u1ebft b\u1ecb t\u01b0\u1eddng l\u1eeda.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/instance.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.instance<\/a><\/td>\n<td>T\u1ea1o v\u00e0 ph\u00e1 h\u1ee7y Linodes.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/instance_info.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.instance_info<\/a><\/td>\n<td>Thu th\u1eadp th\u00f4ng tin v\u1ec1 phi\u00ean b\u1ea3n Linode hi\u1ec7n c\u00f3.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/lke_cluster.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.lke_cluster<\/a><\/td>\n<td>Qu\u1ea3n l\u00fd c\u1ee5m LKE.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/lke_cluster_info.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.lke_cluster_info<\/a><\/td>\n<td>Thu th\u1eadp th\u00f4ng tin v\u1ec1 c\u1ee5m LKE hi\u1ec7n c\u00f3.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/nodebalancer.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.nodebalancer<\/a><\/td>\n<td>T\u1ea1o, h\u1ee7y v\u00e0 c\u1ea5u h\u00ecnh NodeBalancer.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/nodebalancer_info.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.nodebalancer_info<\/a><\/td>\n<td>Thu th\u1eadp th\u00f4ng tin v\u1ec1 NodeBalancer hi\u1ec7n c\u00f3.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/nodebalancer_node.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.nodebalancer_node<\/a><\/td>\n<td>Qu\u1ea3n l\u00fd c\u00e1c n\u00fat NodeBalancer.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/object_cluster_info.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.object_cluster_info<\/a><\/td>\n<td>Thu th\u1eadp th\u00f4ng tin v\u1ec1 c\u00e1c c\u1ee5m l\u01b0u tr\u1eef \u0111\u1ed1i t\u01b0\u1ee3ng.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/object_keys.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.object_keys<\/a><\/td>\n<td>T\u1ea1o v\u00e0 h\u1ee7y kh\u00f3a l\u01b0u tr\u1eef \u0111\u1ed1i t\u01b0\u1ee3ng.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/vlan_info.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.vlan_info<\/a><\/td>\n<td>Thu th\u1eadp th\u00f4ng tin v\u1ec1 Linode VLAN hi\u1ec7n c\u00f3.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/volume.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.volume<\/a><\/td>\n<td>T\u1ea1o, h\u1ee7y v\u00e0 \u0111\u00ednh k\u00e8m c\u00e1c \u1ed5 \u0111\u0129a Linode.<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/modules\/volume_info.md\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.volume_info<\/a><\/td>\n<td>Thu th\u1eadp th\u00f4ng tin v\u1ec1 \u1ed5 \u0111\u0129a Linode hi\u1ec7n c\u00f3.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>C\u00e1c li\u00ean k\u1ebft trong b\u1ea3ng tr\u00ean t\u01b0\u01a1ng \u1ee9ng v\u1edbi c\u00e1c trang GitHub cho m\u1ed7i FQCN. C\u00e1c trang n\u00e0y ch\u1ee9a danh s\u00e1ch t\u1ea5t c\u1ea3 c\u00e1c t\u00f9y ch\u1ecdn c\u1ea5u h\u00ecnh kh\u1ea3 d\u1ee5ng cho t\u00e0i nguy\u00ean m\u00e0 m\u00f4-\u0111un \u00e1p d\u1ee5ng. Danh s\u00e1ch \u0111\u1ea7y \u0111\u1ee7 \u0111\u01b0\u1ee3c c\u1eadp nh\u1eadt \u0111\u1ed9ng c\u1ee7a t\u1ea5t c\u1ea3 c\u00e1c t\u00e0i nguy\u00ean c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c t\u00ecm th\u1ea5y trong&nbsp;<a href=\"https:\/\/github.com\/linode\/ansible_linode\" target=\"_blank\" rel=\"noreferrer noopener\">Linode Ansible Collections Github Repo<\/a>&nbsp;.<\/p>\n<h3 id=\"inventory-plugins\">Plugin ki\u1ec3m k\u00ea<a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#inventory-plugins\"><\/a><\/h3>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>T\u00ean<\/th>\n<th>S\u1ef1 mi\u00eau t\u1ea3<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/github.com\/linode\/ansible_linode\/blob\/main\/docs\/inventory\/instance.rst\" target=\"_blank\" rel=\"noreferrer noopener\">linode.cloud.instance<\/a><\/td>\n<td>\u0110\u1ecdc c\u00e1c b\u1ea3n ki\u1ec3m k\u00ea phi\u00ean b\u1ea3n t\u1eeb Linode.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2 id=\"deploy-a-linode-with-the-linode-ansible-collection\">Tri\u1ec3n khai Linode v\u1edbi Linode Ansible Collection<a href=\"https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/#deploy-a-linode-with-the-linode-ansible-collection\"><\/a><\/h2>\n<p>Ph\u1ea7n n\u00e0y h\u01b0\u1edbng d\u1eabn c\u00e1ch vi\u1ebft s\u1ed5 tay h\u01b0\u1edbng d\u1eabn t\u1eadn d\u1ee5ng b\u1ed9 s\u01b0u t\u1eadp Linode Ansible v\u00e0 m\u00e3 th\u00f4ng b\u00e1o API \u0111\u01b0\u1ee3c m\u00e3 h\u00f3a c\u00f9ng m\u1eadt kh\u1ea9u g\u1ed1c c\u1ee7a b\u1ea1n \u0111\u1ec3 t\u1ea1o phi\u00ean b\u1ea3n Linode m\u1edbi:<\/p>\n<p>1.T\u1ea1o m\u1ed9t t\u1ec7p playbook c\u00f3 t\u00ean&nbsp;<code>deploylinode.yml<\/code>trong&nbsp;<code>~\/development<\/code>th\u01b0 m\u1ee5c c\u1ee7a b\u1ea1n. Sao ch\u00e9p \u0111o\u1ea1n m\u00e3 n\u00e0y v\u00e0o t\u1ec7p v\u00e0 l\u01b0u n\u00f3:<\/p>\n<pre class=\"wp-block-code\"><code>- name: Create Linode Instance\n  hosts: localhost\n  vars_files:\n      - .\/group_vars\/vars.yml\n  tasks:\n    - name: Create a Linode instance\n      linode.cloud.instance:\n        api_token: \"{{ api_token }}\"\n        label: my-ansible-linode\n        type: g6-nanode-1\n        region: us-east\n        image: linode\/ubuntu22.04\n        root_pass: \"{{ password }}\"\n        state: present<\/code><\/pre>\n<ul>\n<li>Playbook ch\u1ee9a&nbsp;<code>Create Linode Instance<\/code>play. Khi ch\u1ea1y, n\u00fat \u0111i\u1ec1u khi\u1ec3n nh\u1eadn \u0111\u01b0\u1ee3c h\u01b0\u1edbng d\u1eabn c\u1ea7n thi\u1ebft t\u1eeb Ansible v\u00e0 s\u1eed d\u1ee5ng API Linode \u0111\u1ec3 tri\u1ec3n khai c\u01a1 s\u1edf h\u1ea1 t\u1ea7ng khi c\u1ea7n.<\/li>\n<li>Kh\u00f3a n\u00e0y&nbsp;<code>vars_files<\/code>cung c\u1ea5p v\u1ecb tr\u00ed c\u1ee7a t\u1ec7p ho\u1eb7c c\u00e1c t\u1ec7p bi\u1ebfn \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 \u0111i\u1ec1n th\u00f4ng tin li\u00ean quan \u0111\u1ebfn c\u00e1c t\u00e1c v\u1ee5 cho v\u1edf k\u1ecbch.<\/li>\n<li>Nhi\u1ec7m v\u1ee5 trong s\u1ed5 tay h\u01b0\u1edbng d\u1eabn \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh b\u1edfi&nbsp;<code>name<\/code>, \u0111\u00f3ng vai tr\u00f2 nh\u01b0 m\u1ed9t nh\u00e3n v\u00e0 FQCN \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 c\u1ea5u h\u00ecnh t\u00e0i nguy\u00ean, trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y l\u00e0 m\u1ed9t phi\u00ean b\u1ea3n t\u00ednh to\u00e1n c\u1ee7a Linode.<\/li>\n<li>C\u00e1c t\u00f9y ch\u1ecdn c\u1ea5u h\u00ecnh li\u00ean quan \u0111\u1ebfn FQCN \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh. C\u00e1c t\u00f9y ch\u1ecdn c\u1ea5u h\u00ecnh cho m\u1ed7i FQCN l\u00e0 duy nh\u1ea5t \u0111\u1ed1i v\u1edbi t\u00e0i nguy\u00ean.\u0110\u1ed1i v\u1edbi c\u00e1c t\u00f9y ch\u1ecdn s\u1eed d\u1ee5ng chu\u1ed7i b\u1ea3o m\u1eadt, c\u00e1c bi\u1ebfn \u0111\u01b0\u1ee3c m\u00e3 h\u00f3a trong&nbsp;<code>.\/group_vars\/vars.yml<\/code>t\u1ec7p s\u1ebd \u0111\u01b0\u1ee3c ch\u00e8n v\u00e0o. Bao g\u1ed3m m\u00e3 th\u00f4ng b\u00e1o API v\u00e0 m\u1eadt kh\u1ea9u g\u1ed1c.<\/li>\n<\/ul>\n<p>2.Sau khi playbook \u0111\u01b0\u1ee3c l\u01b0u, h\u00e3y nh\u1eadp l\u1ec7nh sau \u0111\u1ec3 ch\u1ea1y n\u00f3 v\u00e0 t\u1ea1o m\u1ed9t phi\u00ean b\u1ea3n Linode Nanode. V\u00ec l\u1ec7nh n\u00e0y \u0111\u01b0\u1ee3c ch\u1ea1y t\u1eeb b\u00ean trong&nbsp;<code>~\/development<\/code>th\u01b0 m\u1ee5c c\u1ee7a b\u1ea1n, m\u1eadt kh\u1ea9u Ansible Vault trong&nbsp;<code>.vault-pass<\/code>t\u1ec7p c\u1ee7a b\u1ea1n \u0111\u01b0\u1ee3c playbook s\u1eed d\u1ee5ng \u0111\u1ec3 gi\u1ea3i m\u00e3 c\u00e1c bi\u1ebfn:<\/p>\n<pre class=\"wp-block-code\"><code>ansible-playbook deploylinode.yml\n<\/code><\/pre>\n<p>Sau khi ho\u00e0n t\u1ea5t, \u0111\u1ea7u ra t\u01b0\u01a1ng t\u1ef1 nh\u01b0 sau s\u1ebd xu\u1ea5t hi\u1ec7n:<\/p>\n<pre class=\"wp-block-code\"><code>PLAY &#91;Create Linode] *********************************************************************\n\nTASK &#91;Gathering Facts] *******************************************************************\nok: &#91;localhost]\n\nTASK &#91;Create a new Linode.] **************************************************************\nchanged: &#91;localhost]\n\nPLAY RECAP *******************************************************************************\nlocalhost                  : ok=3    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0<\/code><\/pre>\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:\/\/github.com\/ansible-collections\/overview\" target=\"_blank\" rel=\"noreferrer noopener\">B\u1ed9 s\u01b0u t\u1eadp Ansible<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/linode\/ansible_linode\" target=\"_blank\" rel=\"noreferrer noopener\">B\u1ed9 s\u01b0u t\u1eadp Linode Ansible<\/a><\/li>\n<li><a href=\"https:\/\/galaxy.ansible.com\/linode\/cloud\" target=\"_blank\" rel=\"noreferrer noopener\">Thi\u00ean h\u00e0 Ansible<\/a><\/li>\n<li><a href=\"https:\/\/docs.ansible.com\/ansible\/latest\/user_guide\/playbooks_best_practices.html\" target=\"_blank\" rel=\"noreferrer noopener\">Th\u1ef1c h\u00e0nh t\u1ed1t nh\u1ea5t c\u1ee7a Ansible<\/a><\/li>\n<\/ul>\n<p>Ngu\u1ed3n: https:\/\/www.linode.com\/docs\/guides\/deploy-linodes-using-linode-ansible-collection\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ansible l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 C\u01a1 s\u1edf h\u1ea1 t\u1ea7ng d\u01b0\u1edbi d\u1ea1ng M\u00e3 (IaC) m\u00e3 ngu\u1ed3n m\u1edf ph\u1ed5 bi\u1ebfn c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 ho\u00e0n th\u00e0nh c\u00e1c t\u00e1c v\u1ee5 CNTT ph\u1ed5 bi\u1ebfn nh\u01b0 cung c\u1ea5p \u0111\u00e1m m\u00e2y v\u00e0 qu\u1ea3n l\u00fd c\u1ea5u h\u00ecnh tr\u00ean nhi\u1ec1u th\u00e0nh ph\u1ea7n c\u01a1 s\u1edf h\u1ea1 t\u1ea7ng. Th\u01b0\u1eddng \u0111\u01b0\u1ee3c coi l\u00e0 gi\u1ea3i<\/p>\n","protected":false},"author":1,"featured_media":35681,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129],"tags":[],"class_list":["post-34919","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ansible"],"_links":{"self":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts\/34919","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=34919"}],"version-history":[{"count":0,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/posts\/34919\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/media\/35681"}],"wp:attachment":[{"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/media?parent=34919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/categories?post=34919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jupitek.maudemo.vip\/index.php\/wp-json\/wp\/v2\/tags?post=34919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}