mateuszstompor / rhce-ex294-exam Goto Github PK
View Code? Open in Web Editor NEWRepository containing questions preparing for EX294 exam
License: MIT License
Repository containing questions preparing for EX294 exam
License: MIT License
Questions:
-It is important to know how control node and remote nodes are preset.
-All remote nodes should have the same root password? All these commands will been executed by root on remote hosts, because automation user has not been created yet. Does root user on remote nodes should be configured passwordless?
-Why you use sudo instead of using -u root -k?
-First you should add the inventory hosts in known_hosts, because always request validation, unless you deactivate this first. Did you?
sudo ansible all -m user -a "name=automation password={{ 'devops' | password_hash('sha512', 'salt')}}"
sudo ansible all -m authorized_key -a "key={{ lookup('file', '/home/automation/.ssh/id_rsa.pub') }} user=automation"
sudo ansible all -m copy -a 'content="automation ALL=(ALL) NOPASSWD:ALL" dest=/etc/sudoers.d/automation'
The solution do not take care of a detail. the managed3.example.com is member of the webservers and database host group. So the final motd for this server should have 2 lines:
Welcome to MySQL database
Welcome to Apache server
Your solution do not work properly in this case.
In 03.Archiving solution
If flat parameter for the fetch task is not set to true, it try to store file in
/backup/managed4-configuration.gz/managed4.example.com/backup instead of /backup/
from ansible-doc
flat: # Allows you to override the default behavior of appending hostname/path/to/file to the destination.
If `dest' ends with '/', it will use the basename of the source file, similar to the copy module.
This can be useful if working with a single host, or if retrieving files that are uniquely named per host. If using multiple hosts with the same filename, the file will be overwritten for each host.
authorized_key and openssh_keypair are not part of ansible-core.
And need to be installed separately
ansible-galaxy collection install community.crypto
ansible-galaxy collection install ansible.posix
If authorized_key is going to be executed via sudo, like in solution of 2nd exercise ,make sure that the collection is available for root.
sudo ansible-galaxy collection list ansible.posix
Otherwise will get below error.
"The module authorized_key was redirected to ansible.posix.authorized_key, which could not be loaded."
To fix just re-run collection installation through sudo
sudo ansible-galaxy collection install ansible.posix
ansible database -m setup | grep ansible_local -A 3
Should be
ansible proxy -m setup | grep ansible_local -A 3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.