logoLogcerto Posted August 18, 2022 Share Posted August 18, 2022 hi Link to comment Share on other sites More sharing options...
marco04 Posted September 12, 2022 Share Posted September 12, 2022 tnx Link to comment Share on other sites More sharing options...
Joni Posted October 10, 2022 Share Posted October 10, 2022 tx Link to comment Share on other sites More sharing options...
indarbismoko Posted October 14, 2022 Share Posted October 14, 2022 thx Link to comment Share on other sites More sharing options...
pandreas Posted November 20, 2022 Share Posted November 20, 2022 Quote Link to comment Share on other sites More sharing options...
thustrazara Posted December 31, 2022 Share Posted December 31, 2022 Thank you  Link to comment Share on other sites More sharing options...
uzunaki Posted January 14, 2023 Share Posted January 14, 2023 Thank you. Â Link to comment Share on other sites More sharing options...
zeroacidburn Posted January 16, 2023 Share Posted January 16, 2023 How close this thing to the actual exam? I did notice in Q7 this variable in use (roles.yml) haproxy_backend_servers: - name: node3 address: 172.28.254.13 - name: node4 address: 172.28.254.14 but backends are hardcoded to webservers group. It doesn't make sense to use this variable. It doesn't look like real exam questions in this topic. Any confirmation, guys? Link to comment Share on other sites More sharing options...
ihorvat2407 Posted January 16, 2023 Share Posted January 16, 2023 (edited) 12 hours ago, zeroacidburn said: How close this thing to the actual exam? I did notice in Q7 this variable in use (roles.yml) haproxy_backend_servers: - name: node3 address: 172.28.254.13 - name: node4 address: 172.28.254.14 but backends are hardcoded to webservers group. It doesn't make sense to use this variable. It doesn't look like real exam questions in this topic. Any confirmation, guys? You actually don't have to explicitly use these vars. Balancer role is downloaded in Q5 when you have to use ansible-galaxy to download roles.  Basically, what you need to do for it to work is following:  This is the hidden content, please Sign In or Sign Up The trick is to use phpinfo role before balancer role, otherwise it will not work.  Edited January 16, 2023 by ihorvat2407 27 5 1 Link to comment Share on other sites More sharing options...
zeroacidburn Posted January 17, 2023 Share Posted January 17, 2023 11 hours ago, ihorvat2407 said: You actually don't have to explicitly use these vars. Exactly! That's why I got confused about questions/answers. What's a point to use vars that don't exist in the role?! Did you get a chance to pass ex294? I'm really interesting how close this Q/A to the real ex294 exam?  Quote The trick is to use phpinfo role before balancer role Thanks Link to comment Share on other sites More sharing options...
ihorvat2407 Posted January 17, 2023 Share Posted January 17, 2023 6 hours ago, zeroacidburn said: Exactly! That's why I got confused about questions/answers. What's a point to use vars that don't exist in the role?! Did you get a chance to pass ex294? I'm really interesting how close this Q/A to the real ex294 exam? Â Thanks Original autor (Manofring) answered your question somewhere on the first page. Here's the link:Â Â 2 Link to comment Share on other sites More sharing options...
manofring Posted February 4, 2023 Author Share Posted February 4, 2023 hi, ex294 is actual now or not? Link to comment Share on other sites More sharing options...
manofring Posted February 4, 2023 Author Share Posted February 4, 2023 On 1/16/2023 at 7:12 PM, ihorvat2407 said: You actually don't have to explicitly use these vars. Balancer role is downloaded in Q5 when you have to use ansible-galaxy to download roles.  Basically, what you need to do for it to work is following:  This is the hidden content, please Sign In or Sign Up The trick is to use phpinfo role before balancer role, otherwise it will not work.  its not trick - its is normal ansible workflow, if group is used, group included to 'all' group. u may change execution order, but it is waste time on exam. sorry for my bad english. If u not used ansible roles u never know about its behavior, its have pros and cons 12 1 Link to comment Share on other sites More sharing options...
viper83 Posted February 12, 2023 Share Posted February 12, 2023 TY Link to comment Share on other sites More sharing options...
Teamhardcore Posted February 12, 2023 Share Posted February 12, 2023 thanks  Link to comment Share on other sites More sharing options...
prisoner107 Posted February 17, 2023 Share Posted February 17, 2023 Thanks Link to comment Share on other sites More sharing options...
Teamhardcore Posted February 23, 2023 Share Posted February 23, 2023 thanks Link to comment Share on other sites More sharing options...
Wonga Posted February 25, 2023 Share Posted February 25, 2023 thx Link to comment Share on other sites More sharing options...
apslxpt Posted March 7, 2023 Share Posted March 7, 2023 thks Link to comment Share on other sites More sharing options...
multrog Posted March 16, 2023 Share Posted March 16, 2023 thx Link to comment Share on other sites More sharing options...
Maddog1989 Posted March 20, 2023 Share Posted March 20, 2023 thnx Link to comment Share on other sites More sharing options...
Teamhardcore Posted March 20, 2023 Share Posted March 20, 2023 thanks Link to comment Share on other sites More sharing options...
Teamhardcore Posted March 20, 2023 Share Posted March 20, 2023 thanks Link to comment Share on other sites More sharing options...
abcabc Posted March 22, 2023 Share Posted March 22, 2023 On 12/6/2021 at 1:02 AM, manofring said:  Hidden Content  Q7: Use roles from Ansible Galaxy Create a playbook called /home/greg/ansible/roles.yml as follows: 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. When implemented, browsing to hosts in the balancers host group (for example http://node5.realm8.example.com) should produce the following output: Welcome to node3.realm8.example.com on 172.28.254.13 Reloading the browser should return output from the alternate web server: Welcome to node4.realm8.example.com on 172.28.254.14 The playbook contains a play that runs on hosts in the webservers host group and uses the phpinfo role. When implemented, browsing to hosts in the webservers host group with the URL /hello.php should produce the following output: Hello PHP World from FQDN where FQDN is the fully qualified domain name of the host. For example, browsing to This is the hidden content, please Sign In or Sign Up should produce the following output: Hello PHP World from node3.realm8.example.com along with various details of the PHP configuration including the version of PHP that is installed. Similarly, browsing to This is the hidden content, please Sign In or Sign Up should produce the following output: Hello PHP World from node4.realm8.example.com along with various details of the PHP configuration including the version of PHP that is installed. A7: [greg@control ansible]$ nano -uET2 /home/greg/ansible/roles.yml --- - name: Use balancer role  hosts:   - balancers   - webservers  vars:   haproxy_backend_servers:    - name: node3     address: 172.28.254.13    - name: node4     address: 172.28.254.14  roles:   - { role: balancer, when: "inventory_hostname in groups['balancers']" } - name: Use phpinfo role  hosts: webservers  roles:   - phpinfo or [greg@control ansible]$ nano -uET2 /home/greg/ansible/roles.yml --- - name: Use phpinfo role  hosts: webservers  roles:   - phpinfo - name: Use balancer role  hosts: balancers  vars:   haproxy_backend_servers:    - name: node3     address: 172.28.254.13    - name: node4     address: 172.28.254.14  roles:   - balancer P.S. First aproach work only on balancer hosts group but get facts from webserver hosts group in role filter "when"  roles:   - { role: balancer, when: "inventory_hostname in groups['balancers']" }    Second aproach work whithout when in roles becase "groups['webservers']" already filled [greg@control ansible]$ cat roles/balancer/templates/haproxy.cfg.j2 ..... backend habackend   mode http   balance roundrobin {% for host in groups['webservers'] %}   server {{ hostvars[host].ansible_hostname }}  {{ hostvars[host].ansible_default_ipv4.address}}:80 check {% endfor %}  # check results # Test phpinfo role [greg@control ansible]$ curl -S This is the hidden content, please Sign In or Sign Up | grep Hello  % Total   % Received % Xferd  Average Speed  Time   Time   Time  Current                  Dload  Upload  Total  Spent   Left  Speed  0   0   0   0   0   0    0    0 --:--:-- --:--:-- --:--:--   0Hello PHP World from node3.realm8.example.com<br> 100 59779   0 59779   0   0  7297k    0 --:--:-- --:--:-- --:--:-- 8339k [greg@control ansible]$ curl -S This is the hidden content, please Sign In or Sign Up | grep Hello  % Total   % Received % Xferd  Average Speed  Time   Time   Time  Current                  Dload  Upload  Total  Spent   Left  Speed  0   0   0   0   0   0    0    0 --:--:-- --:--:-- --:--:--   0Hello PHP World from node4.realm8.example.com<br> 100 59778   0 59778   0   0  3891k    0 --:--:-- --:--:-- --:--:-- 3891k # Test balancer role [greg@control ansible]$ watch -n1 curl -S This is the hidden content, please Sign In or Sign Up [greg@control ansible]$ curl -S This is the hidden content, please Sign In or Sign Up Welcome to node3.realm8.example.com on 172.28.254.13 [greg@control ansible]$ curl -S This is the hidden content, please Sign In or Sign Up Welcome to node4.realm8.example.com on 172.28.254.14 [greg@control ansible]$ curl -S This is the hidden content, please Sign In or Sign Up Welcome to node3.realm8.example.com on 172.28.254.13 [greg@control ansible]$ curl -S This is the hidden content, please Sign In or Sign Up Welcome to node4.realm8.example.com on 172.28.254.14   Hi manofring, I followed both your first and second approach for question 7, both approaches also resulted in a haproxy error on the balancer node (See screenshot attached). How do I resolve this error? Link to comment Share on other sites More sharing options...
biz Posted March 22, 2023 Share Posted March 22, 2023 Hey Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now