This shows you the differences between two versions of the page.
scgc:laboratoare:07 [2020/11/25 19:56] alexandru.carp [2. [20p] Puppet Manifests] |
scgc:laboratoare:07 [2021/10/27 14:09] (current) maria.mihailescu |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Laboratory 07. Configuration Management: Puppet, Ansible ====== | + | ====== Configuration Management: Puppet, Ansible ====== |
===== Lab Setup ===== | ===== Lab Setup ===== | ||
- | * We will be using a virtual machine in the [[http://cloud.curs.pub.ro/|faculty's cloud]]. | + | * We will be using a virtual machine in the [[http://cloud.grid.pub.ro/|faculty's cloud]]. |
- | * When creating a virtual machine follow the steps in this [[https://cloud.curs.pub.ro/about/tutorial-for-students/|tutorial]]. | + | |
* When creating a virtual machine in the Launch Instance window: | * When creating a virtual machine in the Launch Instance window: | ||
* Select **Boot from image** in **Instance Boot Source** section | * Select **Boot from image** in **Instance Boot Source** section | ||
Line 30: | Line 29: | ||
===== Tasks ====== | ===== Tasks ====== | ||
- | ==== 1. [20p] Puppet Resources ==== | + | ==== 1. [10p] Puppet Resources ==== |
Puppet is a configuration management tool. In order to describe the necessary configurations, Puppet uses its own declarative language. Puppet can manage both Linux and Windows systems. | Puppet is a configuration management tool. In order to describe the necessary configurations, Puppet uses its own declarative language. Puppet can manage both Linux and Windows systems. | ||
Line 149: | Line 148: | ||
Chech the **/etc/passwd** file to see if the user was actually removed. | Chech the **/etc/passwd** file to see if the user was actually removed. | ||
- | ==== 2. [20p] Puppet Manifests ==== | + | ==== 2. [10p] Puppet Manifests ==== |
Even though we can create, modify or remove resources from the command line, using **puppet resource** commands, this is not a scalable approach and not appropriate for complex scenarios. | Even though we can create, modify or remove resources from the command line, using **puppet resource** commands, this is not a scalable approach and not appropriate for complex scenarios. | ||
Line 465: | Line 464: | ||
</note> | </note> | ||
- | ==== 6. [BONUS - 5p] Ansible Install & Configuration ==== | + | ==== 6. [10p] Ansible Install & Configuration ==== |
Ansible is a configuration management and provisioning tool, similar to Puppet. It uses SSH to connect to servers and run the configured tasks. | Ansible is a configuration management and provisioning tool, similar to Puppet. It uses SSH to connect to servers and run the configured tasks. | ||
Line 538: | Line 537: | ||
* ''%%--ask-pass --user=student%%'' - SSH connection parameters: interactive password input, login as **student** user | * ''%%--ask-pass --user=student%%'' - SSH connection parameters: interactive password input, login as **student** user | ||
- | ==== 7. [BONUS - 5p] Ansible Facter ==== | + | ==== 7. [10p] Ansible Facter ==== |
Ansible has a fact gathering system similar to Puppet. To extract facts about the remote host we can use the ''%%setup%%'' module. The information is returned as Python dictionaries, where values can be strings, arrays, or other dictionaries. | Ansible has a fact gathering system similar to Puppet. To extract facts about the remote host we can use the ''%%setup%%'' module. The information is returned as Python dictionaries, where values can be strings, arrays, or other dictionaries. | ||
Line 581: | Line 580: | ||
student@scgc:~$ mkdir config-files | student@scgc:~$ mkdir config-files | ||
student@scgc:~$ cd config-files | student@scgc:~$ cd config-files | ||
- | student@scgc:~/config-files$ cp /home/student/.google-authenticator . | + | student@scgc:~/config-files$ cp /home/student/.google_authenticator . |
student@scgc:~/config-files$ cp /etc/pam.d/sshd . | student@scgc:~/config-files$ cp /etc/pam.d/sshd . | ||
student@scgc:~/config-files$ cp /etc/ssh/sshd_config . | student@scgc:~/config-files$ cp /etc/ssh/sshd_config . |