2024年11月13日 星期三

【IT Notes】GCP Cloud CDN (Load Balance)建置

 已知道為了保障後端的網站速度,CDN建置是不可避免,這聽起好像是很簡單好理解的東西,但實際上用起來時,還是有很多眉眉角角要注意,這次建置CDN過程也碰到一些問題,並不如一開始想得那樣輕鬆,所以又特別做了一點紀錄,以免將來設定時又碰壁。另外要特留意的是,GCP的Cloud CDN和Load Balance是綁在一起的,不同於AWS是將兩項服務分開,Cloud CDN和負載平衡是不能夠拆開來使用,光這點就有非常大的不同。

2024年10月15日 星期二

【IT Notes】Windows IIS建置與測試網頁

相比起Linux的Apache,Windows的IIS伺服器比較少人用,它主要是ASP的服務平台,但也有支援PHP,這次想測試並學習一IIS,在伺服器上部署PHP和ASP的網頁,雖然是比較冷門的工具,不過還是有少量的市場及需求。

2024年10月7日 星期一

Linux與Windows之爭雜談

 從事IT工作五年了,今天差不多是五年前離開慧科的日子,那時候頂多只會用xampp,而目前已經轉當SE一段時間,自認為有基礎,不過還有待更多經驗的累積。這段時間換過幾份工作環境之後,加上跟同事的聊天發現,Linux和Windows背後都有許多各自的支持者,公司的政策傾向用哪一套系統也跟決策者思維和公司資金很有關係,而兩套系統的背後也影射出自由軟體的支持和反對者的觀點,兩邊對各自所支持的軟體都有很強烈的論點,我想聊一下從業以來的體驗和卓見:

【IT Notes】RHCE測驗補充題 Create and use partitions

Create /home/student/ansible/partition.yml, which will create partitions on managed nodes:

  •  After sdb creating a 1500M primary partition, partition number 1, and format ext4
  •  All groups to permanently mount the partition to /data
  •  If there is not enough disk space, give prompt information  
"Could not create partition of that size"

  •  create 800M partition
  •  If sdb does not exist, a prompt message will be given 
"This disk is not exist"

【題前說明】
這題的做法很類似於第九題,只不過後者是建立邏輯卷宗,而這題是做磁碟切割,難度來說一樣,要會使用不常用的module,首先對每台node的sdb磁區切割出1500MB空間,並將磁區編號命名為1、檔案格式為ext4,根目錄上建立/data資料夾並掛載到sdb1,若磁碟空間不足,要輸出「Could not create partition of that size」的訊息,並將磁區空間分割降為800MB。若完全不存在sdb磁區則是直接輸出「this disk is not exist」。

2024年10月2日 星期三

【IT Notes】RHCE測驗補充題 Use the RHEL system role

 Create a playbook /home/student/ansible/selinux.yml that runs on hosts in the webservers host group and does the following:

  • Uses the selinux RHEL system role.
  • Enables httpd_can_network_connect SELinux boolean.
  • The change must survive system reboot.
【題前說明】
練習的時候沒有出現這題,我猜可能是舊題目,額外在網路上爬到的,因為在練習時有背這題。實際上做法跟第五題一樣,大概是因為過程相同,所以正式考試時只保留其中一題的關係,不過既然都練習過且也有紀錄了,這邊就把它放上來保留著。流程也跟第五題的Roles使用方式一樣,先將mycollection裡面的selinux複製到指定的roles路徑底下,然後寫一個selinux.yml腳本,內容是部署webservers群組內node的selinux config設定為enforcing,也就是強制啟用selinux功能。

【IT Notes】RHCE測驗第十七題 Configure a cron job

Create a playbook called /home/student/ansible/cron.yml that runs on all managed hosts and creates a cron job for user student as follows:

  • The user natasha must configure a cron job that runs every 2 minutes and executes logger “Hello World”

 【題前說明】

完成前面幾題以後,最後這一題算是相對簡單的,只需要在每台主機上建立使用者natasha,並以其身分設定每兩分鐘執行一遍的排程工作,任務就算結束了。

2024年10月1日 星期二

【IT Notes】GCP建立IAM user

GCP也跟AWS一樣,提供非常多的IAM使用者與角色功能,其中之一的最大不同之處,是GCP是透過賦予其它Google帳號權限的方式,讓別組帳號擁有各種不同權限;AWS的話可以直接命名,不需要用信箱帳號之類的,如下圖。

2024年9月29日 星期日

【IT Notes】GCP Compute Engine和Cloud SQL建置

 自從用過AWS的EC2和RDS以後,就難避免也要學會一些GCP的技術,有了AWS基礎後,頭一次用GCP的難度也就沒有那麼高了,不過在一些細節的地方還是有所不同,很多東西用起來可能還不是很習慣,但摸索之後很快還是能理解,這篇就作一些首次建置Compute Engine和Cloud SQL的筆記,下一篇有空再作其他進階功能。

2024年9月10日 星期二

【IT Notes】RHCE測驗第十六題 Rekey an Ansible vault

 Rekey an existing Ansible vault as follows:

【題前說明】

又是一個可以喘口氣的題目,此題只是要考對ansible-vault指令是否熟悉,只需要去data主機把要求的路徑檔案先下載好,然後重新配置檔案的密碼,沒有太多困難的操作,跟上一題比輕鬆很多。

2024年9月5日 星期四

【IT Notes】RHCE測驗第十五題 Create user accounts

  • Download a list of users to be created from http://example.classroom.com/cd/materials/user_list.yml and save it to /home/student/ansible

  • Using the password vault /home/student/ansible/locker.yml created elsewhere in this exam, create a playbook called /home/student/ansible/users.yml that creates user accounts as follows:

    • Users with a job description of developer should be:

      • created on managed nodes in the dev and test host groups
      • assigned the password from the pw_developer variable
      • a member of supplementary group devops
    • Users with a job description of manager should be:

      • created on managed nodes in the prod host group
      • assigned the password from the pw_manager variable
      • a member of supplementary group opsmgr
  • Passwords should use the SHA512 hash format.

  • Your playbook should work using the vault password file /home/student/ansible/secret.txt created elsewhere in this exam.

【題前說明】

這也是一個有相當難度的考題,運用到相當多的迴圈與變數的概念,首先要透過data主機提供的使用者訊資訊yml,內容有user的UID、名稱、群組和密碼變數,再來套用在上一題所創建的加密檔案,內容有變數所需要的帳號和密碼,最後會依照各node所屬群組,分批次方式部署各node索要建立的群組與使用者。難度在於要清楚地分辨哪些node要建立哪些使用者與群組。依據題目內容再解說更詳細一點,這題先要在dev和test的node上,建立devops群組,然後建立屬於devops的使用者與密碼;再於prod的node上,建立opsmgr群組,然後建立屬於opsmgr的使用者與密碼。這些user的密碼皆使用SHA512的加密方式。

2024年9月3日 星期二

【IT Notes】AWS建立IAM user

 記得剛開始上AWS課程時,就被教育要盡量避免用root來操作,為了安全起見,root的最大權限應該少被拿來用在系統的建置等,而且用來監控帳單和成本用,雖然實際上還是很多人用root作業,不過還是盡量養成習慣,想要用管理員權限的話,通常還是建議透過IAM使用者來做事,而且其實很多服務都有跟IAM作關連,所以學習一下IAM還是很重要的。

這次情境就是遇到用戶想分開管理權限,root使用者帳號他要收回去自己使用,於是就得另外先建立屬於我們自己的IAM管理員帳號。

2024年8月29日 星期四

【IT Notes】RHCE測驗第十四題 Create a password vault

Create an Ansible vault to store user passwords as follows:

  • The name of the vault is /home/student/ansible/locker.yml

  • The vault contains two variables with names:

    • pw_developer with value Imadev
    • pw_manager with value Imamgr
  • The password to encrypt and decrypt the vault is retent

  • The password is stored in the file /home/student/ansible/secret.txt

【題前說明】

這題要是給喘口氣用的,因為前後兩題都是較難的題型。主要重點是先建立一個secret.txt檔,裡面放的是密碼是retent,再來建立個locker.yml檔,裡面內容是一對變數檔,目的是為了提供後面的另一個題目解題使用,所以看起來簡單,可是若做不出來或錯誤的話,另一題也就會跟著報銷。經過ansible-valut指令會將locker.yml加密,必須要用到secret.txt才能夠解密,雖然簡單但也考驗加密的觀念。

【IT Notes】Nginx建置Load Balancer,做網站負載平衡

 Nginx因為很少用到,所以我對它很不熟悉,這次想學習之外,也想測試自己做一個load balance環境。負載平衡在中大型的網路環境裡是滿常見的設計,其實也是proxy的概念,目的除了讓流量分散、讓網站loading減輕以外,也可以做到failover,也就是其中一台主機當掉,網站仍然可以維持運作,最後則是proxy的設計也能有效保護上游的主機,上游主機不需要開放對外的網路,所有流量都必須先透過proxy節點,如果設計良好,至少遭到攻擊的時候不會影響到上游。

2024年8月23日 星期五

【IT Notes】RHCE測驗第十三題 Generate a hardware report

 Create a playbook called /home/student/ansible/hwreport.yml that produces an output file called /root/hwreport.txt on all managed nodes with the following information:

  • Inventory host name

  • Total memory in MB

  • BIOS version

  • Size of disk device sda

  • Size of disk device sdb

  • Each line of the output file contains a single key=value pair.

Your playbook should:

【題前說明】

這是會用到大量變數概念的題目,解法也很多種,我學的只是一種比較懶惰的寫法,分數可能不高,但仍可以達到題目所要求的結果。首先要去data主機上下載hwreport.empty檔到本地的/root底下,將檔名改成hwreport.txt,檔案裡面的參數很重要,要依照裡面的參數來編輯ansible用部署的變數。基本的邏輯是:key去讀取hwreport.txt裡面的所對應文字當標題,並當作變數的參照;value根據ansible facts去每一台node抓取資料會來當值,並放置到所對應的key後面,若沒有找到相對應的值則輸出NONE。敘述這段好像在繞口令,這題也是我在練習時花免多時間去理解的,難度大概可以排名前三。

2024年8月19日 星期一

【IT Notes】RHCE測驗第十二題 Create a web content directory

 Create a playbook called /home/student/ansible/webcontent.yml as follows:

  • The playbook runs on managed nodes in the dev host group

  • Create the directory /webdev with the following requirements:

    • it is owned by the webdev group
    • it has regular permissions: owner=read+write+execute, group=read+write+execute, other=read+execute
    • it has special permissions: set group ID
  • Symbolically link /var/www/html/webdev to /webdev

  • Create the file /webdev/index.html with a single line of text that reads: Development

  • Browsing this directory on hosts in the dev host group (for example http://node1.example.com/webdev/) produces the following output:

    Development

【題前說明】

前面有幾題在webservers群組上作網站部署,這題則是回到dev群組,也就是node1上也部署一個網頁,而網頁路徑有指定一個資料夾名為/webdev(位於根目錄底下),同時要設定群組、SELinux權限,再來於資料夾內新增index當作首頁,首頁內容為Devlopment,再透過軟連結的方式指向網頁伺服器的根目錄,最後則是開啟防火牆允許apache啟用。難度不算高,但是步驟多也就表示要背的指令及流程也多。

【IT Notes】建立GLPI資產管理網站+配置SSL憑證

 很久之前就架設過GLPI了,當時偷懶沒留下文件,最近需要一個網站來做SSL憑證的測試,並且用Route53來驗證TXT紀錄,今天就回顧一下GLPI的安裝流程,然後最後再來幫它上個https憑證。

2024年8月15日 星期四

【IT Notes】Windows製作登入Linux金鑰

一直以來都是用帳號密碼來登入Linux,雖然已經知道可以用金鑰登入的方式,可是始終沒有養成習慣,主因是金鑰要好好保管有點麻煩,有時候重灌或是偷懶就會找不到,但最近覺得如果需要安全又方便的話,還是多練一下用金鑰登入主機會比較好。

30年前謠言?原來確有其事

經常覺得自己小時候的記憶並不可靠,尤其是到了快要不惑之年,當回憶離現在愈來愈遙遠時,雖然還沒有到已經忘記或沒有印象的程度,但還是非常懷疑自己的記憶牢不牢靠,甚至會覺得當時一定是聽錯或記錯。

2024年8月14日 星期三

【IT Notes】Route53建立主網域,並建立子網域的A紀錄

 Route53是AWS的DNS服務,因為幾乎不可能不付錢,如果沒有真正的需求,所以我一直都還沒有試用過,這次有一個機會要做測試,剛好藉此機會買了一個網域來試,申請完畢以後,直接就拿來做更多的實驗,而實驗內容就新建一個子網域的A紀錄給網站來使用。

2024年8月12日 星期一

【IT Notes】RHCE測驗第十一題 Modify file content

 Create a playbook called /home/student/ansible/issue.yml as follows:

  • The playbook runs on all inventory hosts

  • The playbook replaces the contents of /etc/issue with a single line of text as follows:

    • On hosts in the dev host group, the line reads: Development
    • On hosts in the test host group, the line reads: Test
    • On hosts in the prod host group, the line reads: Production

【題前說明】
這一題的重點是變數的運用,先建立一個變數用的資料夾,然後在裡面分別建立Development、Test和Production三個群組的檔案,檔案內容則是變數,最後再回到外面建立yml檔,內容要能夠去讀取變數檔,並且部署到三個群組的/etc/issue底下。整體來說是比較簡單的題目,感覺是給考生稍微放鬆和給分用的。

2024年8月7日 星期三

時光匆匆

 最近天氣熱,常常感到心煩氣躁,有時候需要靜下心或找一點事情做,好讓自己可以專心。有很多文件想寫但是卻沒有什麼動力,所以懶起來就選擇回憶一下以前的事情,回頭看這2024已經過超過一半了,從歐洲回來也已經剛好五個月了,這段時間除了新工作的適應和考試以外,其實也沒有娛樂,拍火車也很少去,前陣子倒是忙於做試管,雖然沒有成功又花很多錢,但起碼有點眉目,不再像剛開始做那麼樣的無頭蒼蠅。

2024年7月25日 星期四

【IT Notes】RHCE測驗第十題 Generate a hosts file

  • Download an initial template file from http://example.classroom.com/cd/materials/hosts.j2 to /home/student/ansible

  • Complete the template so that it can be used to generate a file with a line for each inventory host in the same format as /etc/hosts

  • Download the file from http://example.classroom.com/cd/materials/hosts.yml to /home/student/ansible/hosts.yml. This playbook will use the template to generate the file /etc/myhosts on hosts in the dev host group.

    • Do not make any changes to the playbook.

When the playbook is run, the file /etc/myhosts on hosts in the dev host group should have a line for each managed host:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

172.25.250.10 node1.example.com node1
172.25.250.11 node2.example.com node2
172.25.250.12 node3.example.com node3
172.25.250.13 node4.example.com node4
172.25.250.14 node5.example.com node5

NOTE: The order in which the inventory host names appear is not important.

【題前說明】

這一題要做的是去data主機下載兩個檔案,一個是hosts.j2作為template;另一個是hosts.yml作部署用檔案,比較困難的是又要用到查詢ansible facts的能力,將查詢到的node上的facts,寫在hosts.j2裡面當作變數,並且作一個迴圈,讓最後ansible跑部署的時候把五台node的IP address、FQDN和Hostname寫成一個myhost檔,然後只放在dev群組的主機指定路徑底下。


2024年7月15日 星期一

【IT Notes】RHCE測驗第九題 CREATE AND USE A LOGICAL VOLUME

 Create a playbook called /home/studnet/ansible/lvm.yml that runs on all managed nodes that does the following:

  • Creates a logical volume with these requirements:

    • The logical volume is created in the research volume group
    • The logical volume name is data
    • The logical volume size is 1500 MiB
  • Formats the logical volume with the ext4 filesystem

  • If the requested logical volume size cannot be created, the error message

    Could not create logical volume of that size

    should be displayed and the size 800 MiB should be used instead.

  • If the volume group research does not exist, the error message

    Volume group does not exist

    should be displayed.

  • Does NOT mount the logical volume in any way.

【題前說明】
這題是較困難的題目之一,如果是用指令處理的話很快,但要用ansible部署的話就變得比要複雜,主要是要用到的module較多一些。基本的邏輯是,主機上research這個volume group者,先建立一個1500MB的lvm,如果空間不夠,族輸出「Could not create logical volume of that size的訊息,然後改成800MB,並且命名為data;主機上沒有research這個volume group的話,則輸出「Volume group does not exist」的訊息。

2024年7月9日 星期二

【IT Notes】地端主機mount AWS S3的方式

 混合雲大概是不可避免的趨勢,有時候主機放在地端會比較便宜且方便,若遇到要串接雲端的時候,這又變成了一門學問,這次要測試的主題是在地端的Linux主機mount AWS的S3,過程有一點小繁瑣,必須記錄一下以免之後會用得到。流程是先新建一個S3 Bucket、建立傳遞的user與role,最後在地端主機上mount S3 Bucket。

2024年7月4日 星期四

【IT Notes】RHCE測驗第八題 USE ROLES FROM ANSIBLE GALAXY

 Create a playbook called /home/student/ansible/roles.yml with the following requirements:

  • The playbook contains a play that runs on hosts in the balancers host group and uses the balancer role.

    • This role configures a service to load balance web server requests between hosts in the webservers host group.
    • Browsing to hosts in the balancers host group (for example http://node5.example.com/) produces the following output:
      Welcome to node3.example.com on 172.25.250.12
    • Reloading the browser produces output from the alternate web server:
      Welcome to node4.example.com on 172.25.250.13
  • The playbook contains a play that runs on hosts in the webservers host group and uses the phpinfo role.

    • Browsing to hosts in the webservers host group with the URL /hello.php produces the following output:

      Hello PHP World from FQDN

      where FQDN is the fully qualified domain name of the host.

    • For example, browsing to http://node3.example.com/hello.php, produces the following output:

      Hello PHP World from node3.example.com

      along with various details of the PHP configuration including the version of PHP that is installed.

    • Similarly, browsing to http://node4.example.com/hello.php, produces the following output:

      Hello PHP World from node4.example.com

      along with various details of the PHP configuration including the version of PHP that is installed.


【題前說明】

這題落落長寫了一大堆看似很嚇人,卻是解題過程最短的,乍看之下以為要做什麼大工程,其實就只是把第六題下載並安裝好的兩個roles分別套用到兩個群組上:balancer套用在balancers群組上;phpinfo套用在webservers群組,用的指令是ansible-galaxy,最後還要自己驗證一下結果。

2024年6月27日 星期四

【IT Notes】建立AWS的EC2與MySQL

 雖然是比較基礎的操作,不過我也是第一次使用,說來也挺慚愧,AWS都推出那麼久了,到今天我才開始接觸它。不同於自己建VirtualBox的VM可以隨時隨地慢慢玩,AWS的服務得要很注意預算問題,平常不會為了想要測試而那筆花錢,畢竟有些服務是真的滿昂貴的,萬一開了又沒用,不小心就會收到很可觀的帳單,所以難得有機會遇到有客戶要做代管,就趁機會記錄AWS建置服務的流程。這次要建立的服務主要是EC2和MySQL,除了一般建置之外,也要很留意版本和成本。

【IT Notes】RHCE測驗第七題 CREATE AND USE A ROLE

 Create a role called apache in /home/student/ansible/roles with the following requirememts:

  • The httpd package is installed, enabled on boot, and started

  • The firewall is enabled and running with a rule to allow access to the web server

  • A template file index.html.j2 exists and is used to create the file /var/www/html/index.html with the following output:

    Welcome to HOSTNAME on IPADDRESS

    where HOSTNAME is the fully qualified domain name of the managed node and IPADDRESS is the IP address of the managed node.

Create a playbook called /home/student/ansible/newrole.yml that uses this role as follows:

  • The playbook runs on hosts in the webservers host group

【題前說明】
這題是要用背的了,要建立一個客製化的roles,自己寫一個apache的yml和輸出客製字符index的template,然後用ansible部署到webserver的node上面,聽起來有點複雜,不過只要弄清楚邏輯和流程,用背的其實也沒有太困難。

2024年6月25日 星期二

【IT Notes】Windows Server 2022建立VPN服務

 最近有個客戶提出請求,說他的Windows上的程式必須要要限制用戶僅能透過VPN連入,沒有走VPN的話就不能使用該服務,而此客戶也沒有準備硬體防火牆,所以只能用Windows Server內建的VPN+防火牆功能,我也是第一次安裝這種功能,就紀錄一下以便之後也有客戶會想用這種功能。

【IT Notes】RHCE測驗第六題 INSTALL ROLES USING ANSIBLE GALAXY

Use Ansible Galaxy with a requirements file called /home/student/ansible/roles/requirements.yml to download and install roles to the default roles directory /home/student/ansible/roles from the following URLs:


【題前說明】
 這題要用ansible galaxy安裝兩個function,分別是php和負載平衡功能,題目其實很簡單,我覺得比較難的是我自己模擬不出load balance的功能,這兩支程式是從補習班老師那邊取得的,抓過來我就直接放在Data主機上供解題時的下載點。

2024年6月24日 星期一

【IT Notes】RHCE測驗第五題 USE A RHEL SYSTEM ROLE

Making use of the redhat.rhel_system_roles collection installed in another item create a playbook called /home/student/ansible/timesync.yml that:

  • Runs on all managed nodes

  • Uses the timesync role

  • Configures the role to use the currently active NTP provider

  • Configures the role to use the time server 172.25.250.15

  • Configures the role to enable the iburst parameter


【題前說明】
 這題開始要用到roles了,而且也呼應前面第三題,萬一前面做不出來,這題當然也就報銷了。簡單來說,就是把collections裡面的timesyc roles複製到家目錄下剛新建的的roles裡面,然後讓ansible使用它,為每一台node部署校時的chronyd,跟Data主機作時間校對。

蒸汽火車紀錄(三)

2024/2/3北門車庫園區
修復好的SL21每個月的首個周六會在北門和嘉義車站載客行駛,也是林鐵目前可以常態行駛的燒煤蒸汽火車,鍋爐重製以後比原本的大一圈,也很佩服林鐵有辦法讓這種百年老車重新上路。

 
                                                                2022/12/5 阿里山神木車站
常駐於阿里山上的SL31,每年都有固定出來活動筋骨,這天是去阿里山是碰到有旅行社包車,火車行駛於對高岳、沼平、阿里山和神木,記得這天邊爬山邊追火車還滿辛苦的,幸好在神木站待機滿久的,讓大家殺一殺手機空間。

2024年6月23日 星期日

【IT Notes】Supermicro伺服器+PVE安裝

 到新公司後的第一個任務之一就是幫客戶安裝VPE在Supermicro上,PVE在安裝VM上去,這兩件事都是我完全沒有用過的東西,前公司雖然用過Supermicro的伺服器,但是我對它完全不熟,PVE則是Esxi的免費替代品,據知Esxi要收費之後,PVE就成了很多人的首要選擇,它們功能大致上都一樣,學習上並不算難,而且免費的東西人人愛啊!幹嘛不學起來?

2024年6月19日 星期三

【IT Notes】AWS SAA-C03重點整理

 花了三個多月的時間,考了兩次才通過這次考試,必須說AWS SAA-C03真的有難度,共用了一個月上線上課程、兩個月做考古題,覺得還是勤做考古題比較有效果,光是聽課就只是產生一點印象,做考古題才能知道自己有哪些細節不熟,回頭再去補強。即使準備充足,還是得要懂得應付考試的題目的眉角,這邊就整理一下自己這三個月以來的考古題筆記。

2024年5月29日 星期三

【IT Notes】Ubuntu 22.04安裝Zabbix並監控其他主機

 公司使用Zabbix已經很久了,但我一直都沒有自己好好研究和安裝過它,這次剛好有機會要幫用戶監控,所以就從零開始做起,挑選Ubuntu當我的OS,安裝完以後我還要監控其他台Linux和Windows來做測試。

2024年4月3日 星期三

【IT Notes】RHCE測驗第四題 INSTALL PACKAGES

Create a playbook called /home/student/ansible/packages.yml that:

  • Installs the php and mariadb packages on hosts in the devtest, and prod host groups

  • Installs the RPM Development Tools package group on hosts in the dev host group

  • Updates all packages to the latest version on hosts in the dev host group

【題前說明】
 這是很入門的考題,目的只是要安裝php和mariadb在node1、node2、node3和node4上;然後node1上再多裝dev tools,並且更新每一台node上的套件至最新版本,全部動作都用ansible來部署。

【IT Notes】RHCE測驗第三題 INSTALL A COLLECTION

Install the following collection artifacts available  from http://example.classroom.com/materials to workstation as the user student

  • redhat-rhel_system_roles-1.16.2.tar.gz

  • ansible-posix-1.4.0.tar.gz

  • community-general-4.3.0.tar.gz

The collections should be installed into the default collections directory /home/student/ansible/mycollections


【題前說明】
 這題在RHCE8是沒有的,以前的roles和collections只要用指令yum install rhel-system-roles就幫我都安裝好了,但RHCE9就等要全部手動處理,如果這題做不出來的話,後面許多題目也就沒法繼續進下去,roles和collections裡面包含著很多後面解題要用到的function,而且這是一個新課程內容,記得去年以前都還沒有上過,不過其實也沒有很困難,只是要很注意每一步驟不要做錯了。

2024年3月27日 星期三

【IT Notes】RHCE測驗第二題 CREATE YUM REPOSITORIES

As a system administrator, you will need to install software on the managed nodes. Create the playbook /home/student/ansible/yum_repo.yml which creates the following yum repositories on each of the managed nodes as follows:

【題前說明】
 這題在RHCE8不是用yml來做的,而是用shell的方式安裝yum repo,到了RHCE9以後就變成要求要用ansible執行yml來部署,這題要是做不出來的話,當然後面的很多題目可能也就沒有檔案可以下載,最後考試
也泡湯了。如同下面的第三題,這兩題讓我印象深刻,因為我是上RHCE8,但考前上了衝刺班得到了改版後改提也變更的資訊,一個禮拜之內趕緊補強這幾題,幸虧最後來得及複習,但考是坐我旁邊的同學就沒那麼幸運,記得當時他很慌張,因為他也跟我一樣是上一版本的課程,不過他沒有上衝刺班,等於第二和第三題他都不曉得,所以得要強調這幾題目前的變化!


2024年3月23日 星期六

【IT Notes】RHCE測驗第一題 INSTALL AND CONFIGURE ANSIBLE

Install and configure Ansible on the control node workstation.example.com as follows:

  • Install the required packages

  • Create a static inventory file called /home/student/ansible/inventory so that:

    • node1 is a member of the dev host group
    • node2 is a member of the test host group
    • node3 and node4 are members of the prod host group
    • node5 is a member of the balancers host group
    • The prod group is a member of the webservers host group
  • Create a configuration file called /home/student/ansible/ansible.cfg so that:

    • The host inventory file is /home/student/ansible/inventory
    • The default content collections directory is /home/student/ansible/mycollections
    • The default roles directory is /home/student/ansible/roles

【題前說明】
 第一題只是很單純地依題目要求把環境和路徑都先設定好,唯一不同於上一個版本的地方就是多了mycollections的設定,這會影響到第三題和後面很多會用到roles的題目,記得當時寫解題的時候我把config檔內的
mycollections路徑打錯了,因為卡住幾分鐘的時間被迫回頭檢查兩次後才發現,當時也算是冒了一點冷汗。

2024年3月12日 星期二

【IT Notes】RHCE考試環境建置

大半年沒有寫網誌了,除了結婚的籌備和蜜月旅行以外,我還忙了一段時間在處理搬家事宜,再來是上一分工作實在沒有太多技術文件可以寫,大部分時間都在搞infra,而且重複性很高,目前換了新工作,又回到Linux環境了,但是考試已經過了半年,得要趕快趁還沒有忘記考試內容前把細節記錄下來,以便將來遇到時有用。考試環境的練習,是先能夠要建立七台VM,大部分的網路上解答都沒有提到這部分,但其實它也很重要

【IT Notes】透過api移轉Gmail到Exchange

 在雲端裡面串接api不是一件很好學的技術,第一次有機會學習到將GWS的Gmail信件全部轉移到M365的Exchange,其實方法很多種,像以前用的pst檔匯出轉移的方式等,但透過api串接,可以批次和排程轉移,是非常方便且準確的作法。唯一讓人感到困難的是學習成本不小,通常需要...