Ansible stat Module: ตรวจสอบ File Status และ Permissions

Ansible stat Module: ตรวจสอบ File Status และ Permissions

Ansible stat module ใช้ตรวจสอบสถานะของ filesystem object บน remote server ก่อนดำเนินการอื่น — เช่น ตรวจว่ามีไฟล์อยู่หรือไม่, ขนาด, permissions, owner, checksum หรือว่าเป็น symlink โดยไม่ต้องรัน command: ls -la ตรง ๆ บทความนี้ครอบคลุม parameters หลัก, การอ่านค่าจาก stat result, การใช้ร่วมกับ when con

Ansible docker Module: Deploy Docker Container ด้วย Ansible

Ansible docker Module: Deploy Docker Container ด้วย Ansible

Ansible docker_container module (ส่วนหนึ่งของ community.docker collection) ใช้ deploy และจัดการ container บน remote server โดยตรงใน Playbook ครอบคลุมการสร้าง, หยุด, ลบ container, กำหนด environment variables, volumes, networks และ restart policy โดยไม่ต้องรัน docker run ตรง ๆ ซึ่งไม่ idempotent บทควา

Ansible git Module: Clone Pull Git Repository อัตโนมัติ

Ansible git Module: Clone Pull Git Repository อัตโนมัติ

Ansible git module ใช้ clone และ pull repository จาก Git server ไปยัง remote server โดยตรงใน Playbook โดยไม่ต้องรัน command: git clone ตรง ๆ ซึ่งไม่ idempotent และต้องจัดการ error handling เอง บทความนี้ครอบคลุม parameters หลัก, การ clone และ update repository, การกำหนด branch/tag/commit, การใช้ SSH

Ansible file Module: Create Delete Modify File Permissions

Ansible file Module: Create Delete Modify File Permissions

Ansible file module ใช้จัดการ filesystem objects บน remote server ครอบคลุมการสร้างและลบไฟล์/directory, กำหนด permissions, ownership และ symbolic links โดยไม่ต้องใช้ command รัน chmod, chown หรือ mkdir ตรง ๆ ซึ่งมักไม่ idempotent บทความนี้ครอบคลุม state ทั้งหมดที่รองรับ, การกำหนด owner, group และ mod

Ansible user Module: สร้าง Delete User บนระบบ

Ansible user Module: สร้าง Delete User บนระบบ

Ansible user module ใช้จัดการ Linux account ครอบคลุมตั้งแต่การสร้าง, ลบ, แก้ไข home directory, ตั้งรหัสผ่าน, กำหนด group, ไปจนถึง SSH authorized keys โดยไม่ต้องใช้ command รัน useradd หรือ usermod ตรง ๆ ซึ่งมักไม่ idempotent บทความนี้อธิบายการใช้ user module ครอบคลุม parameters หลัก, การสร้างและลบ a

Ansible service Module: Start Stop Restart Services

Ansible service Module: Start Stop Restart Services

Ansible service module ใช้จัดการ system daemon บน Linux ผ่าน init system ที่หลากหลาย ไม่ว่าจะเป็น systemd, SysV init, หรือ Upstart โดยไม่ต้องรู้ว่าเซิร์ฟเวอร์ใช้ init system อะไร module จะจัดการให้อัตโนมัติ ทำให้ Playbook ทำงานได้ข้ามหลาย distro บทความนี้ครอบคลุม syntax พื้นฐาน, state ทั้งหมดที่รองร

Ansible shell Module และ command Module: รัน Commands บน Server

Ansible shell Module และ command Module: รัน Commands บน Server

Ansible มี 2 module สำหรับรัน commands บน remote server คือ command และ shell ความแตกต่างหลักอยู่ที่ command รันคำสั่งโดยตรงโดยไม่ผ่าน shell ทำให้ปลอดภัยกว่าแต่ไม่รองรับ shell features เช่น pipe (|), redirect (>), หรือ environment variables ส่วน shell รันผ่าน /bin/sh จึงรองรับ shell syntax ครบถ้ว

Ansible lineinfile Module: แก้ไข Single Line ในไฟล์

Ansible lineinfile Module: แก้ไข Single Line ในไฟล์

Ansible lineinfile module ใช้แก้ไขไฟล์ text โดยเพิ่ม, แก้ไข, หรือลบบรรทัดเดียวตาม pattern ที่กำหนด เหมาะสำหรับกรณีที่ต้องการแก้ค่า config เดียวในไฟล์ขนาดใหญ่ เช่น เปลี่ยน parameter ใน /etc/ssh/sshd_config หรือเพิ่ม entry ใน /etc/hosts โดยไม่ต้อง overwrite ไฟล์ทั้งหมด บทความนี้อธิบายการใช้ lineinfile

Ansible template Module: Deploy Dynamic Configuration Files

Ansible template Module: Deploy Dynamic Configuration Files

Ansible template module ใช้สร้างไฟล์บน remote server จาก template ที่มี Jinja2 syntax โดยแทนค่า variables และ expressions ก่อน deploy ต่างจาก copy module ที่ส่งไฟล์ static ตรงๆ template ช่วยให้ config file เดียวสามารถปรับเปลี่ยนได้ตามค่า inventory, facts, หรือ variables ของแต่ละ host บทความนี้อธิบาย

Ansible copy Module: Copy Files ไปยัง Remote Servers

Ansible copy Module: Copy Files ไปยัง Remote Servers

Ansible copy module ใช้คัดลอกไฟล์จาก control node (เครื่องที่รัน Ansible) ไปยัง remote server หรือสร้างไฟล์จาก content ที่กำหนดโดยตรงใน Playbook เป็น module พื้นฐานที่ใช้บ่อยมากในงาน configuration management ตั้งแต่ deploy config files, certificates, ไปจนถึง scripts บทความนี้อธิบายการใช้ copy module

LINE CHAT