-
-
Save sbeliakou/a2fc5e6a3196ac9aa1f677b6e5004fa5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cloning into 'anton_antanovich'... | |
name: anton_antanovich, master/849acf1 @ 2021-03-11 08:42:23 +0000 | |
2021/03/13 21:56:37 config: tests/encryption.yml | |
2021/03/13 21:56:37 verbosity: 2 | |
2021/03/13 21:56:37 ----------------------------------------------------------------------------------- | |
2021/03/13 21:56:37 Running '2.1 Working with Secrets', 1..8 tests | |
2021/03/13 21:56:37 ----------------------------------------------------------------------------------- | |
2021/03/13 21:56:37 ✓ [2.1 Working with Secrets] => 'spoiler1' decrypted correctly (1), 15ms | |
2021/03/13 21:56:37 ✓ [2.1 Working with Secrets] => 'spoiler2' decrypted correctly (1), 12ms | |
2021/03/13 21:56:37 ✓ [2.1 Working with Secrets] => 'spoiler3' decrypted correctly (1), 12ms | |
2021/03/13 21:56:37 ✓ [2.1 Working with Secrets] => 'spoiler4' decrypted correctly (1), 11ms | |
2021/03/13 21:56:39 ✓ [2.1 Working with Secrets] => 'secret1' encrypted with tag=dev (v1.2/AES256) (1), 24ms | |
2021/03/13 21:56:39 ✓ [2.1 Working with Secrets] => 'secret2' encrypted with tag=test (v1.2/AES256) (1), 15ms | |
2021/03/13 21:56:39 ✓ [2.1 Working with Secrets] => 'secret3' encrypted with tag=stage (v1.2/AES256) (1), 22ms | |
2021/03/13 21:56:39 ✓ [2.1 Working with Secrets] => 'secret4' encrypted with tag=prod (v1.2/AES256) (1), 23ms | |
2021/03/13 21:56:39 ----------------------------------------------------------------------------------- | |
2021/03/13 21:56:39 Tests Summary: | |
2021/03/13 21:56:39 8 (of 8) tests passed, 0 tests failed; rated as 100.00% | |
2021/03/13 21:56:39 | |
2021/03/13 21:56:39 Time Spent: 1.512s | |
2021/03/13 21:56:39 ----------------------------------------------------------------------------------- | |
name: anton_antanovich, master/849acf1 @ 2021-03-11 08:42:23 +0000 | |
2021/03/13 21:56:39 config: tests/role-deps.yml | |
2021/03/13 21:56:39 verbosity: 2 | |
2021/03/13 21:56:39 ----------------------------------------------------------------------------------- | |
2021/03/13 21:56:39 Running '2.2 Role Dependencies', 1..17 tests | |
2021/03/13 21:56:39 ----------------------------------------------------------------------------------- | |
2021/03/13 21:56:41 ✗ [2.2 Role Dependencies] -> 'base' linter | |
2021/03/13 21:56:41 Result: exit status 2 | |
2021/03/13 21:56:41 Output: | |
Added ANSIBLE_ROLES_PATH=~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:roles | |
WARNING Listing 1 violation(s) that are fatal | |
unnamed-task: All tasks should be named | |
roles/base/tasks/main.yml:1 Task/Handler: debug msg=running {{ role_name }} role | |
You can skip specific rules or tags by adding them to your configuration file: | |
# .ansible-lint | |
warn_list: # or 'skip_list' to silence them completely | |
- unnamed-task # All tasks should be named | |
Finished with [1;34m1 failure(s), [1;34m0 warning(s) on [1;34m2 files. | |
2021/03/13 21:56:44 ✗ [2.2 Role Dependencies] -> 'java' linter | |
2021/03/13 21:56:44 Result: exit status 2 | |
2021/03/13 21:56:44 Output: | |
Added ANSIBLE_ROLES_PATH=~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:roles | |
WARNING Listing 1 violation(s) that are fatal | |
unnamed-task: All tasks should be named | |
roles/java/tasks/main.yml:1 Task/Handler: debug msg=running {{ role_name }} role | |
You can skip specific rules or tags by adding them to your configuration file: | |
# .ansible-lint | |
warn_list: # or 'skip_list' to silence them completely | |
- unnamed-task # All tasks should be named | |
Finished with [1;34m1 failure(s), [1;34m0 warning(s) on [1;34m4 files. | |
2021/03/13 21:56:47 ✗ [2.2 Role Dependencies] -> 'tomcat' linter | |
2021/03/13 21:56:47 Result: exit status 2 | |
2021/03/13 21:56:47 Output: | |
Added ANSIBLE_ROLES_PATH=~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:roles | |
WARNING Listing 1 violation(s) that are fatal | |
unnamed-task: All tasks should be named | |
roles/tomcat/tasks/main.yml:1 Task/Handler: debug msg=running {{ role_name }} role | |
You can skip specific rules or tags by adding them to your configuration file: | |
# .ansible-lint | |
warn_list: # or 'skip_list' to silence them completely | |
- unnamed-task # All tasks should be named | |
Finished with [1;34m1 failure(s), [1;34m0 warning(s) on [1;34m3 files. | |
2021/03/13 21:56:50 ✗ [2.2 Role Dependencies] -> 'nginx-base' linter | |
2021/03/13 21:56:50 Result: exit status 2 | |
2021/03/13 21:56:50 Output: | |
Added ANSIBLE_ROLES_PATH=~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:roles | |
WARNING Listing 1 violation(s) that are fatal | |
unnamed-task: All tasks should be named | |
roles/nginx-base/tasks/main.yml:1 Task/Handler: debug msg=running {{ role_name }} role | |
You can skip specific rules or tags by adding them to your configuration file: | |
# .ansible-lint | |
warn_list: # or 'skip_list' to silence them completely | |
- unnamed-task # All tasks should be named | |
Finished with [1;34m1 failure(s), [1;34m0 warning(s) on [1;34m3 files. | |
2021/03/13 21:56:55 ✗ [2.2 Role Dependencies] -> 'nginx-custom' linter | |
2021/03/13 21:56:55 Result: exit status 2 | |
2021/03/13 21:56:55 Output: | |
Added ANSIBLE_ROLES_PATH=~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:roles | |
WARNING Listing 1 violation(s) that are fatal | |
unnamed-task: All tasks should be named | |
roles/nginx-custom/tasks/main.yml:1 Task/Handler: debug msg=running {{ role_name }} role | |
You can skip specific rules or tags by adding them to your configuration file: | |
# .ansible-lint | |
warn_list: # or 'skip_list' to silence them completely | |
- unnamed-task # All tasks should be named | |
Finished with [1;34m1 failure(s), [1;34m0 warning(s) on [1;34m3 files. | |
2021/03/13 21:56:55 ✗ [2.2 Role Dependencies] -> 'user' linter | |
2021/03/13 21:56:55 Result: exit status 1 | |
2021/03/13 21:56:55 Output: | |
2021/03/13 21:56:55 ✓ [2.2 Role Dependencies] => 'tomcat' role depends on 'java' role (1), 11ms | |
2021/03/13 21:56:55 ✓ [2.2 Role Dependencies] => 'tomcat' role calls 'java' role with 'java_version' parameter (1), 7ms | |
2021/03/13 21:56:55 ✓ [2.2 Role Dependencies] => 'tomcat' role depends on 'user' role (1), 14ms | |
2021/03/13 21:56:55 ✓ [2.2 Role Dependencies] => 'tomcat' role calls 'user' role with 'user_name' parameter (1), 5ms | |
2021/03/13 21:56:55 ✓ [2.2 Role Dependencies] => 'tomcat' role calls 'user' role with 'user_id' parameter (1), 10ms | |
2021/03/13 21:56:55 ✓ [2.2 Role Dependencies] => 'tomcat' role calls 'user' role with 'group_id' parameter (1), 8ms | |
2021/03/13 21:56:55 ✓ [2.2 Role Dependencies] => 'tomcat' role calls 'user' role with 'user_home' parameter (1), 7ms | |
2021/03/13 21:56:55 ✓ [2.2 Role Dependencies] => 'tomcat' role depends on 'base' role (1), 8ms | |
2021/03/13 21:56:55 ✓ [2.2 Role Dependencies] => 'java' role depends on 'base' role (1), 12ms | |
2021/03/13 21:56:55 ✓ [2.2 Role Dependencies] => 'nginx-base' role depends on 'base' role (1), 19ms | |
2021/03/13 21:56:55 ✓ [2.2 Role Dependencies] => 'nginx-custom' role depends on 'nginx-base' role (1), 6ms | |
2021/03/13 21:56:55 ----------------------------------------------------------------------------------- | |
2021/03/13 21:56:55 Tests Summary: | |
2021/03/13 21:56:55 11 (of 17) tests passed, 6 tests failed; rated as 64.71% | |
2021/03/13 21:56:55 | |
2021/03/13 21:56:55 Time Spent: 16.592s | |
2021/03/13 21:56:55 ----------------------------------------------------------------------------------- | |
name: anton_antanovich, master/849acf1 @ 2021-03-11 08:42:23 +0000 | |
2021/03/13 21:56:55 config: tests/base.yml | |
2021/03/13 21:56:55 verbosity: 2 | |
2021/03/13 21:56:55 ----------------------------------------------------------------------------------- | |
2021/03/13 21:56:55 Running '2.3 Base Role (centos 7)', 1..11 tests | |
2021/03/13 21:56:55 ----------------------------------------------------------------------------------- | |
2021/03/13 21:57:03 ✗ [2.3 Base Role (centos 7)] -> Role Linter | |
2021/03/13 21:57:03 Result: exit status 2 | |
2021/03/13 21:57:03 Output: | |
Added ANSIBLE_ROLES_PATH=~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:roles | |
WARNING Listing 1 violation(s) that are fatal | |
no-changed-when: Commands should not change things if nothing needs doing | |
roles/base/tasks/main.yml:24 Task/Handler: latest pip | |
You can skip specific rules or tags by adding them to your configuration file: | |
# .ansible-lint | |
warn_list: # or 'skip_list' to silence them completely | |
- no-changed-when # Commands should not change things if nothing needs doing | |
Finished with [1;34m1 failure(s), [1;34m0 warning(s) on [1;34m2 files. | |
2021/03/13 21:57:04 ✓ [2.3 Base Role (centos 7)] => playbook syntax check (1), 1.081s | |
2021/03/13 21:57:46 ✓ [2.3 Base Role (centos 7)] => apply role (5), 42.109s | |
2021/03/13 21:57:59 ✗ [2.3 Base Role (centos 7)] -> idempotence check (apply the role twice) | |
2021/03/13 21:57:59 Result: exit status 1 | |
2021/03/13 21:57:59 Output: | |
[0;34mUsing /tmp/students-2/anton_antanovich/day2/2.3/ansible.cfg as config file | |
PLAY [all] ********************************************************************* | |
TASK [base : Check facts directory state=directory, path=/etc/ansible/facts.d, recurse=True] *** | |
[0;32mok: [centos7] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/etc/ansible/facts.d", "size": 4096, "state": "directory", "uid": 0} | |
TASK [base : Gathering facts fact_path=/etc/ansible/facts.d] ******************* | |
[0;32mok: [centos7] | |
TASK [base : epel-release installer name=epel-release, curl, wget, sudo, iproute, state=latest] *** | |
[0;32mok: [centos7] => {"ansible_facts": {}, "changed": false, "changes": {"installed": [], "updated": []}, "msg": "", "rc": 0, "results": ["All packages providing epel-release are up to date", "All packages providing curl are up to date", "All packages providing wget are up to date", "All packages providing sudo are up to date", "All packages providing iproute are up to date", ""]} | |
TASK [base : python name=python3, python3-pip, python-devel] ******************* | |
[0;32mok: [centos7] => {"ansible_facts": {}, "changed": false, "msg": "", "rc": 0, "results": ["python3-3.6.8-18.el7.x86_64 providing python3 is already installed", "python3-pip-9.0.3-8.el7.noarch providing python3-pip is already installed", "python-devel-2.7.5-90.el7.x86_64 providing python-devel is already installed"]} | |
TASK [base : latest pip _raw_params=pip install --upgrade pip] ***************** | |
[0;33mchanged: [centos7] => {"ansible_facts": {}, "changed": true, "cmd": ["pip", "install", "--upgrade", "pip"], "delta": "0:00:01.234890", "end": "2021-03-13 21:57:57.524437", "rc": 0, "start": "2021-03-13 21:57:56.289547", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)", "stdout_lines": ["Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)"]} | |
TASK [base : Install pymysql name=pymysql, state=present] ********************** | |
[0;32mok: [centos7] => {"ansible_facts": {}, "changed": false, "cmd": ["/bin/pip2", "install", "pymysql"], "name": ["pymysql"], "requirements": null, "state": "present", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.\n", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)\n", "stdout_lines": ["Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)"], "version": null, "virtualenv": null} | |
PLAY RECAP ********************************************************************* | |
[0;33mcentos7 : [0;32mok=6 [0;33mchanged=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 | |
2021-03-13 21:57:58,915 p=10833 u=root n=ansible | centos7 : ok=6 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 | |
2021/03/13 21:57:59 ✗ [2.3 Base Role (centos 7)] -> role installs 'epel' repo | |
2021/03/13 21:57:59 Result: exit status 1 | |
2021/03/13 21:57:59 Output: | |
2021-03-13 21:57:51,304 p=10833 u=root n=ansible | TASK [base : epel-release installer name=epel-release, curl, wget, sudo, iproute, state=latest] *** | |
2021-03-13 21:57:54,891 p=10833 u=root n=ansible | ok: [centos7] => {"ansible_facts": {}, "changed": false, "changes": {"installed": [], "updated": []}, "msg": "", "rc": 0, "results": ["All packages providing epel-release are up to date", "All packages providing curl are up to date", "All packages providing wget are up to date", "All packages providing sudo are up to date", "All packages providing iproute are up to date", ""]} | |
2021/03/13 21:57:59 ✗ [2.3 Base Role (centos 7)] -> role installs 'curl' package | |
2021/03/13 21:57:59 Result: exit status 1 | |
2021/03/13 21:57:59 Output: | |
2021-03-13 21:57:51,304 p=10833 u=root n=ansible | TASK [base : epel-release installer name=epel-release, curl, wget, sudo, iproute, state=latest] *** | |
2021-03-13 21:57:54,891 p=10833 u=root n=ansible | ok: [centos7] => {"ansible_facts": {}, "changed": false, "changes": {"installed": [], "updated": []}, "msg": "", "rc": 0, "results": ["All packages providing epel-release are up to date", "All packages providing curl are up to date", "All packages providing wget are up to date", "All packages providing sudo are up to date", "All packages providing iproute are up to date", ""]} | |
2021/03/13 21:57:59 ✗ [2.3 Base Role (centos 7)] -> role installs 'wget' package | |
2021/03/13 21:57:59 Result: exit status 1 | |
2021/03/13 21:57:59 Output: | |
2021-03-13 21:57:51,304 p=10833 u=root n=ansible | TASK [base : epel-release installer name=epel-release, curl, wget, sudo, iproute, state=latest] *** | |
2021-03-13 21:57:54,891 p=10833 u=root n=ansible | ok: [centos7] => {"ansible_facts": {}, "changed": false, "changes": {"installed": [], "updated": []}, "msg": "", "rc": 0, "results": ["All packages providing epel-release are up to date", "All packages providing curl are up to date", "All packages providing wget are up to date", "All packages providing sudo are up to date", "All packages providing iproute are up to date", ""]} | |
2021/03/13 21:57:59 ✗ [2.3 Base Role (centos 7)] -> role installs 'sudo' package | |
2021/03/13 21:57:59 Result: exit status 1 | |
2021/03/13 21:57:59 Output: | |
2021-03-13 21:57:51,304 p=10833 u=root n=ansible | TASK [base : epel-release installer name=epel-release, curl, wget, sudo, iproute, state=latest] *** | |
2021-03-13 21:57:54,891 p=10833 u=root n=ansible | ok: [centos7] => {"ansible_facts": {}, "changed": false, "changes": {"installed": [], "updated": []}, "msg": "", "rc": 0, "results": ["All packages providing epel-release are up to date", "All packages providing curl are up to date", "All packages providing wget are up to date", "All packages providing sudo are up to date", "All packages providing iproute are up to date", ""]} | |
2021/03/13 21:57:59 ✗ [2.3 Base Role (centos 7)] -> role installs 'iproute' package | |
2021/03/13 21:57:59 Result: exit status 1 | |
2021/03/13 21:57:59 Output: | |
2021-03-13 21:57:51,304 p=10833 u=root n=ansible | TASK [base : epel-release installer name=epel-release, curl, wget, sudo, iproute, state=latest] *** | |
2021-03-13 21:57:54,891 p=10833 u=root n=ansible | ok: [centos7] => {"ansible_facts": {}, "changed": false, "changes": {"installed": [], "updated": []}, "msg": "", "rc": 0, "results": ["All packages providing epel-release are up to date", "All packages providing curl are up to date", "All packages providing wget are up to date", "All packages providing sudo are up to date", "All packages providing iproute are up to date", ""]} | |
2021/03/13 21:57:59 ✗ [2.3 Base Role (centos 7)] -> role installs 'python-pip' package | |
2021/03/13 21:57:59 Result: exit status 1 | |
2021/03/13 21:57:59 Output: | |
2021/03/13 21:57:59 ✓ [2.3 Base Role (centos 7)] => role creates ansible facts folder (1), 142ms | |
2021/03/13 21:58:00 ----------------------------------------------------------------------------------- | |
2021/03/13 21:58:00 Tests Summary: | |
2021/03/13 21:58:00 3 (of 11) tests passed, 8 tests failed; rated as 36.84% | |
2021/03/13 21:58:00 | |
2021/03/13 21:58:00 Time Spent: 1m4.059s | |
2021/03/13 21:58:00 ----------------------------------------------------------------------------------- | |
name: anton_antanovich, master/849acf1 @ 2021-03-11 08:42:23 +0000 | |
2021/03/13 21:58:00 config: tests/user.yml | |
2021/03/13 21:58:00 verbosity: 2 | |
2021/03/13 21:58:00 ----------------------------------------------------------------------------------- | |
2021/03/13 21:58:00 Running '2.3 User Role (CentOS 7)', 1..17 tests | |
2021/03/13 21:58:00 ----------------------------------------------------------------------------------- | |
2021/03/13 21:58:06 ✓ [2.3 User Role (CentOS 7)] => Role Linter (1), 4.804s | |
2021/03/13 21:58:07 ✓ [2.3 User Role (CentOS 7)] => playbook syntax check (1), 1.331s | |
2021/03/13 21:58:20 ✗ [2.3 User Role (CentOS 7)] -> apply role | |
2021/03/13 21:58:20 Result: exit status 2 | |
2021/03/13 21:58:20 Output: | |
- hosts: all | |
gather_facts: no | |
vars: | |
user_name: debug6 | |
roles: | |
- user | |
- hosts: all | |
gather_facts: no | |
roles: | |
- role: user | |
user_name: debug1 | |
- role: user | |
user_name: debug2 | |
user_group: debug2_group | |
- role: user | |
user_name: debug3 | |
user_id: 1234 | |
user_group: debug3_group | |
- role: user | |
user_name: debug4 | |
user_id: 1345 | |
user_group: debug2_group | |
user_gid: 1366 | |
- role: user | |
user_name: debug5 | |
user_home: /opt/debug5_home | |
- role: user | |
user_name: debug7 | |
user_home_create: no | |
- role: user | |
user_name: debug8 | |
user_shell: /usr/bin/false | |
- role: user | |
user_name: debug9 | |
user_sudo_privs: "ALL=(ALL) NOPASSWD:ALL" | |
[0;34mUsing /tmp/students-2/anton_antanovich/day2/2.3/ansible.cfg as config file | |
PLAY [all] ********************************************************************* | |
TASK [user : Create group debug6] ********************************************** | |
[0;33mchanged: [centos7] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": true, "gid": 1077, "name": "debug6", "state": "present", "system": false} | |
TASK [user : Create user debug6] *********************************************** | |
[0;33mchanged: [centos7] => {"ansible_facts": {}, "changed": true, "comment": "", "create_home": true, "group": 1077, "home": "/home/debug6", "name": "debug6", "shell": "/bin/sh", "state": "present", "system": false, "uid": 1077} | |
TASK [user : Give sudo privileges] ********************************************* | |
[0;36mskipping: [centos7] => {"changed": false, "skip_reason": "Conditional result was False"} | |
PLAY [all] ********************************************************************* | |
TASK [user : Create group debug1] ********************************************** | |
[0;31mfatal: [centos7]: FAILED! => {"ansible_facts": {}, "changed": false, "msg": "groupadd: GID '1077' already exists\n", "name": "debug1"} | |
PLAY RECAP ********************************************************************* | |
[0;31mcentos7 : [0;32mok=2 [0;33mchanged=2 unreachable=0 [0;31mfailed=1 [0;36mskipped=1 rescued=0 ignored=0 | |
2021/03/13 21:58:26 ✗ [2.3 User Role (CentOS 7)] -> idempotence check (apply role twice) | |
2021/03/13 21:58:26 Result: exit status 2 | |
2021/03/13 21:58:26 Output: | |
[0;34mUsing /tmp/students-2/anton_antanovich/day2/2.3/ansible.cfg as config file | |
PLAY [all] ********************************************************************* | |
TASK [user : Create group debug6 gid={{ user_gid }}, name={{ user_group }}] **** | |
[0;32mok: [centos7] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "gid": 1077, "name": "debug6", "state": "present", "system": false} | |
TASK [user : Create user debug6 uid={{ user_id }}, name={{ user_name }}, create_home={{ user_home_create }}, home={{ user_home }}, shell={{ user_shell }}, group={{ user_group }}] *** | |
[0;32mok: [centos7] => {"ansible_facts": {}, "append": false, "changed": false, "comment": "", "group": 1077, "home": "/home/debug6", "move_home": false, "name": "debug6", "shell": "/bin/sh", "state": "present", "uid": 1077} | |
TASK [user : Give sudo privileges path=/etc/sudoers.d/{{ user_name }}, state=present, create=True, line=%{{ user_name }} {{ user_sudo_privs }}, validate=/usr/sbin/visudo -cf %s] *** | |
[0;36mskipping: [centos7] => {"changed": false, "skip_reason": "Conditional result was False"} | |
PLAY [all] ********************************************************************* | |
TASK [user : Create group debug1 gid={{ user_gid }}, name={{ user_group }}] **** | |
[0;31mfatal: [centos7]: FAILED! => {"ansible_facts": {}, "changed": false, "msg": "groupadd: GID '1077' already exists\n", "name": "debug1"} | |
PLAY RECAP ********************************************************************* | |
[0;31mcentos7 : [0;32mok=2 changed=0 unreachable=0 [0;31mfailed=1 [0;36mskipped=1 rescued=0 ignored=0 | |
2021/03/13 21:58:26 ✗ [2.3 User Role (CentOS 7)] -> use "user_name" varaible | |
2021/03/13 21:58:26 Result: exit status 1 | |
2021/03/13 21:58:26 Output: | |
id: debug1: no such user | |
2021/03/13 21:58:26 ✗ [2.3 User Role (CentOS 7)] -> use "user_name", "user_group" variables | |
2021/03/13 21:58:26 Result: exit status 1 | |
2021/03/13 21:58:26 Output: | |
id: debug2: no such user | |
2021/03/13 21:58:27 ✗ [2.3 User Role (CentOS 7)] -> use "user_name", "user_id", "user_group" variables | |
2021/03/13 21:58:27 Result: exit status 1 | |
2021/03/13 21:58:27 Output: | |
id: debug3: no such user | |
2021/03/13 21:58:27 ✗ [2.3 User Role (CentOS 7)] -> use "user_name", "user_id", "user_group", "user_gid" variables | |
2021/03/13 21:58:27 Result: exit status 1 | |
2021/03/13 21:58:27 Output: | |
id: debug4: no such user | |
2021/03/13 21:58:27 ✗ [2.3 User Role (CentOS 7)] -> use "user_home" variable | |
2021/03/13 21:58:27 Result: exit status 1 | |
2021/03/13 21:58:27 Output: | |
2021/03/13 21:58:27 ✗ [2.3 User Role (CentOS 7)] -> set correct home permissions | |
2021/03/13 21:58:27 Result: exit status 1 | |
2021/03/13 21:58:27 Output: | |
stat: cannot stat ‘/opt/debug5_home’: No such file or directory | |
2021/03/13 21:58:27 ✗ [2.3 User Role (CentOS 7)] -> user owns its home directory | |
2021/03/13 21:58:27 Result: exit status 1 | |
2021/03/13 21:58:27 Output: | |
stat: cannot stat ‘/opt/debug5_home’: No such file or directory | |
2021/03/13 21:58:28 ✓ [2.3 User Role (CentOS 7)] => use "user_name" from play vars (1), 205ms | |
2021/03/13 21:58:28 ✗ [2.3 User Role (CentOS 7)] -> doesn't create home dir if required | |
2021/03/13 21:58:28 Result: exit status 1 | |
2021/03/13 21:58:28 Output: | |
2021/03/13 21:58:28 ✗ [2.3 User Role (CentOS 7)] -> use "user_shell" variable | |
2021/03/13 21:58:28 Result: exit status 1 | |
2021/03/13 21:58:28 Output: | |
2021/03/13 21:58:28 ✗ [2.3 User Role (CentOS 7)] -> setting custom sudo priviliges | |
2021/03/13 21:58:28 Result: exit status 1 | |
2021/03/13 21:58:28 Output: | |
sudo: unknown user: debug9 | |
sudo: unable to initialize policy plugin | |
2021/03/13 21:58:28 ✓ [2.3 User Role (CentOS 7)] => doesn't create sudo priviliges for all users (1), 162ms | |
2021/03/13 21:58:28 ✓ [2.3 User Role (CentOS 7)] => setting custom sudo priviliges - checking validation parameter (1), 11ms | |
2021/03/13 21:58:30 ----------------------------------------------------------------------------------- | |
2021/03/13 21:58:30 Tests Summary: | |
2021/03/13 21:58:30 5 (of 17) tests passed, 12 tests failed; rated as 20.00% | |
2021/03/13 21:58:30 | |
2021/03/13 21:58:30 Time Spent: 30.625s | |
2021/03/13 21:58:30 ----------------------------------------------------------------------------------- | |
name: anton_antanovich, master/849acf1 @ 2021-03-11 08:42:23 +0000 | |
2021/03/13 21:58:30 config: tests/webapp-server.yml | |
2021/03/13 21:58:30 verbosity: 2 | |
2021/03/13 21:58:30 ----------------------------------------------------------------------------------- | |
2021/03/13 21:58:30 Running '2.3 WebApp-Server Role (centos 7)', 1..17 tests | |
2021/03/13 21:58:30 ----------------------------------------------------------------------------------- | |
2021/03/13 21:58:37 ✓ [2.3 WebApp-Server Role (centos 7)] => role linter (1), 5.46s | |
2021/03/13 21:58:39 ✓ [2.3 WebApp-Server Role (centos 7)] => playbook syntax check (1), 1.26s | |
2021/03/13 21:59:44 ✓ [2.3 WebApp-Server Role (centos 7)] => apply role (5), 1m4.94s | |
2021/03/13 22:00:05 ✗ [2.3 WebApp-Server Role (centos 7)] -> idempotence check (apply the role twice) | |
2021/03/13 22:00:05 Result: exit status 1 | |
2021/03/13 22:00:05 Output: | |
(run, /tmp/students-2/anton_antanovich/day2/2.3) => ansible-playbook testing-role-webapp-server.yml -i default, -v -e ansible_host=centos7 | |
rc: 0 | |
output: | | |
[0;34mUsing /tmp/students-2/anton_antanovich/day2/2.3/ansible.cfg as config file | |
PLAY [all] ********************************************************************* | |
TASK [base : Check facts directory] ******************************************** | |
[0;32mok: [default] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/etc/ansible/facts.d", "size": 4096, "state": "directory", "uid": 0} | |
TASK [base : Gathering facts] ************************************************** | |
[0;32mok: [default] | |
TASK [base : epel-release installer] ******************************************* | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "changes": {"installed": [], "updated": []}, "msg": "", "rc": 0, "results": ["All packages providing epel-release are up to date", "All packages providing curl are up to date", "All packages providing wget are up to date", "All packages providing sudo are up to date", "All packages providing iproute are up to date", ""]} | |
TASK [base : python] *********************************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "msg": "", "rc": 0, "results": ["python3-3.6.8-18.el7.x86_64 providing python3 is already installed", "python3-pip-9.0.3-8.el7.noarch providing python3-pip is already installed", "python-devel-2.7.5-90.el7.x86_64 providing python-devel is already installed"]} | |
TASK [base : latest pip] ******************************************************* | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "cmd": ["pip", "install", "--upgrade", "pip"], "delta": "0:00:01.007436", "end": "2021-03-13 21:59:54.470536", "rc": 0, "start": "2021-03-13 21:59:53.463100", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)", "stdout_lines": ["Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)"]} | |
TASK [base : Install pymysql] ************************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "cmd": ["/bin/pip2", "install", "pymysql"], "name": ["pymysql"], "requirements": null, "state": "present", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.\n", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)\n", "stdout_lines": ["Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)"], "version": null, "virtualenv": null} | |
TASK [user : Create group webapp-server] *************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "gid": 1099, "name": "webapp-server", "state": "present", "system": false} | |
TASK [user : Create user webapp-server] **************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "append": false, "changed": false, "comment": "", "group": 1099, "home": "/opt/webapp-server/", "move_home": false, "name": "webapp-server", "shell": "/bin/sh", "state": "present", "uid": 1099} | |
TASK [user : Give sudo privileges] ********************************************* | |
[0;36mskipping: [default] => {"changed": false, "skip_reason": "Conditional result was False"} | |
TASK [webapp-server : Make bin folder] ***************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "gid": 1099, "group": "webapp-server", "mode": "0755", "owner": "webapp-server", "path": "/opt/webapp-server//bin", "size": 4096, "state": "directory", "uid": 1099} | |
TASK [webapp-server : Make conf folder] **************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "gid": 1099, "group": "webapp-server", "mode": "0755", "owner": "webapp-server", "path": "/opt/webapp-server//conf", "size": 4096, "state": "directory", "uid": 1099} | |
TASK [webapp-server : Download executable file] ******************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "checksum_dest": null, "checksum_src": null, "dest": "/opt/webapp-server//bin/webapp-server", "elapsed": 0, "gid": 1099, "group": "webapp-server", "mode": "0750", "msg": "file already exists", "owner": "webapp-server", "size": 6213632, "state": "file", "uid": 1099, "url": "https://playpit-labs-assets.s3-eu-west-1.amazonaws.com/webapp-server/webapp-server"} | |
TASK [webapp-server : Copy configuration files] ******************************** | |
[0;32mok: [default] => {"changed": false, "checksum": "b1fac666bd0b94c02bfa937a0de22e4f3ae5d112", "dest": "/opt/webapp-server//conf/webapp-server.conf", "gid": 1099, "group": "webapp-server", "mode": "0644", "owner": "webapp-server", "path": "/opt/webapp-server//conf/webapp-server.conf", "size": 165, "state": "file", "uid": 1099} | |
TASK [webapp-server : Copy service file] *************************************** | |
[0;32mok: [default] => {"changed": false, "checksum": "a0341b16f2d005be4300497c2ef6f740287204da", "dest": "/etc/systemd/system/webapp-server.service", "gid": 1099, "group": "webapp-server", "mode": "0644", "owner": "webapp-server", "path": "/etc/systemd/system/webapp-server.service", "size": 306, "state": "file", "uid": 1099} | |
TASK [webapp-server : Make sure a service is running] ************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "enabled": true, "name": "webapp-server", "state": "started", "status": {"ActiveEnterTimestamp": "Sat 2021-03-13 21:59:44 UTC", "ActiveEnterTimestampMonotonic": "350677321877", "ActiveExitTimestamp": "Sat 2021-03-13 21:59:44 UTC", "ActiveExitTimestampMonotonic": "350677311230", "ActiveState": "active", "After": "basic.target network.target system.slice systemd-journald.socket", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "yes", "AssertTimestamp": "Sat 2021-03-13 21:59:44 UTC", "AssertTimestampMonotonic": "350677320307", "Before": "shutdown.target multi-user.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "ConditionResult": "yes", "ConditionTimestamp": "Sat 2021-03-13 21:59:44 UTC", "ConditionTimestampMonotonic": "350677320306", "Conflicts": "shutdown.target", "ControlGroup": "/docker/cb00c34b221d10c44a7a2577017503c7ea18e2af33ebdf84fdd8b1326703dcf1/system.slice/webapp-server.service", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "Simple WebApp Server", "DevicePolicy": "auto", "EnvironmentFile": "/opt/webapp-server//conf/webapp-server.conf (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "4043", "ExecMainStartTimestamp": "Sat 2021-03-13 21:59:44 UTC", "ExecMainStartTimestampMonotonic": "350677321805", "ExecMainStatus": "0", "ExecStart": "{ path=/opt/webapp-server/bin/webapp-server ; argv[]=/opt/webapp-server//bin/webapp-server ; ignore_errors=no ; start_time=[Sat 2021-03-13 21:59:44 UTC] ; stop_time=[n/a] ; pid=4043 ; code=(null) ; status=0/0 }", "ExecStop": "{ path=/bin/kill ; argv[]=/bin/kill -s QUIT $MAINPID ; ignore_errors=no ; start_time=[Sat 2021-03-13 21:59:44 UTC] ; stop_time=[Sat 2021-03-13 21:59:44 UTC] ; pid=4042 ; code=exited ; status=0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/etc/systemd/system/webapp-server.service", "Group": "webapp-server", "GuessMainPID": "yes", "IOScheduling": "0", "Id": "webapp-server.service", "IgnoreOnIsolate": "no", "IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestamp": "Sat 2021-03-13 21:59:44 UTC", "InactiveEnterTimestampMonotonic": "350677319875", "InactiveExitTimestamp": "Sat 2021-03-13 21:59:44 UTC", "InactiveExitTimestampMonotonic": "350677321877", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "67108864", "LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "1048576", "LimitNPROC": "18446744073709551615", "LimitRSS": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "29790", "LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": "4043", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": "webapp-server.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "Requires": "basic.target", "Restart": "no", "RestartUSec": "100ms", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitInterval": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "running", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": "18446744073709551615", "TasksMax": "18446744073709551615", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "simple", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "enabled", "User": "webapp-server", "WantedBy": "multi-user.target", "Wants": "system.slice", "WatchdogTimestamp": "Sat 2021-03-13 21:59:44 UTC", "WatchdogTimestampMonotonic": "350677321847", "WatchdogUSec": "0"}} | |
TASK [webapp-server : Wait for webserver] ************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "elapsed": 1, "match_groupdict": {}, "match_groups": [], "path": null, "port": 8080, "search_regex": null, "state": "started"} | |
PLAY RECAP ********************************************************************* | |
[0;33mdefault : [0;32mok=15 [0;33mchanged=1 unreachable=0 failed=0 [0;36mskipped=1 rescued=0 ignored=0 | |
Stdout Assertion Failed (Partial, 'changed=0') | |
2021/03/13 22:00:05 ✓ [2.3 WebApp-Server Role (centos 7)] => role depends on 'user' role (1), 10ms | |
2021/03/13 22:00:05 ✓ [2.3 WebApp-Server Role (centos 7)] => passing variables to 'user' role: 'webapp_server_user' (1), 9ms | |
2021/03/13 22:00:05 ✓ [2.3 WebApp-Server Role (centos 7)] => passing variables to 'user' role: 'webapp_server_group' (1), 9ms | |
2021/03/13 22:00:05 ✓ [2.3 WebApp-Server Role (centos 7)] => service responds 200 (1), 252ms | |
2021/03/13 22:00:05 ✓ [2.3 WebApp-Server Role (centos 7)] => service is enabled (1), 178ms | |
2021/03/13 22:00:05 ✗ [2.3 WebApp-Server Role (centos 7)] -> service runs under proper user/group | |
2021/03/13 22:00:05 Result: exit status 1 | |
2021/03/13 22:00:05 Output: | |
2021/03/13 22:00:06 ✗ [2.3 WebApp-Server Role (centos 7)] -> application user has no password set | |
2021/03/13 22:00:06 Result: exit status 1 | |
2021/03/13 22:00:06 Output: | |
2021/03/13 22:00:27 ✗ [2.3 WebApp-Server Role (centos 7)] -> stress-test: updating server application | |
2021/03/13 22:00:27 Result: exit status 1 | |
2021/03/13 22:00:27 Output: | |
[0;34mUsing /tmp/students-2/anton_antanovich/day2/2.3/ansible.cfg as config file | |
PLAY [all] ********************************************************************* | |
TASK [base : Check facts directory] ******************************************** | |
[0;32mok: [default] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/etc/ansible/facts.d", "size": 4096, "state": "directory", "uid": 0} | |
TASK [base : Gathering facts] ************************************************** | |
[0;32mok: [default] | |
TASK [base : epel-release installer] ******************************************* | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "changes": {"installed": [], "updated": []}, "msg": "", "rc": 0, "results": ["All packages providing epel-release are up to date", "All packages providing curl are up to date", "All packages providing wget are up to date", "All packages providing sudo are up to date", "All packages providing iproute are up to date", ""]} | |
TASK [base : python] *********************************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "msg": "", "rc": 0, "results": ["python3-3.6.8-18.el7.x86_64 providing python3 is already installed", "python3-pip-9.0.3-8.el7.noarch providing python3-pip is already installed", "python-devel-2.7.5-90.el7.x86_64 providing python-devel is already installed"]} | |
TASK [base : latest pip] ******************************************************* | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "cmd": ["pip", "install", "--upgrade", "pip"], "delta": "0:00:00.897237", "end": "2021-03-13 22:00:16.353302", "rc": 0, "start": "2021-03-13 22:00:15.456065", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)", "stdout_lines": ["Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)"]} | |
TASK [base : Install pymysql] ************************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "cmd": ["/bin/pip2", "install", "pymysql"], "name": ["pymysql"], "requirements": null, "state": "present", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.\n", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)\n", "stdout_lines": ["Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)"], "version": null, "virtualenv": null} | |
TASK [user : Create group webapp-server] *************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "gid": 1099, "name": "webapp-server", "state": "present", "system": false} | |
TASK [user : Create user webapp-server] **************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "append": false, "changed": false, "comment": "", "group": 1099, "home": "/opt/webapp-server/", "move_home": false, "name": "webapp-server", "shell": "/bin/sh", "state": "present", "uid": 1099} | |
TASK [user : Give sudo privileges] ********************************************* | |
[0;36mskipping: [default] => {"changed": false, "skip_reason": "Conditional result was False"} | |
TASK [webapp-server : Make bin folder] ***************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "gid": 1099, "group": "webapp-server", "mode": "0755", "owner": "webapp-server", "path": "/opt/webapp-server//bin", "size": 4096, "state": "directory", "uid": 1099} | |
TASK [webapp-server : Make conf folder] **************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "gid": 1099, "group": "webapp-server", "mode": "0755", "owner": "webapp-server", "path": "/opt/webapp-server//conf", "size": 4096, "state": "directory", "uid": 1099} | |
TASK [webapp-server : Download executable file] ******************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "checksum_dest": null, "checksum_src": null, "dest": "/opt/webapp-server//bin/webapp-server", "elapsed": 0, "gid": 1099, "group": "webapp-server", "mode": "0750", "msg": "file already exists", "owner": "webapp-server", "size": 6213632, "state": "file", "uid": 1099, "url": "https://playpit-labs-assets.s3-eu-west-1.amazonaws.com/webapp-server/v1.0.2/webapp-server"} | |
TASK [webapp-server : Copy configuration files] ******************************** | |
[0;32mok: [default] => {"changed": false, "checksum": "b1fac666bd0b94c02bfa937a0de22e4f3ae5d112", "dest": "/opt/webapp-server//conf/webapp-server.conf", "gid": 1099, "group": "webapp-server", "mode": "0644", "owner": "webapp-server", "path": "/opt/webapp-server//conf/webapp-server.conf", "size": 165, "state": "file", "uid": 1099} | |
TASK [webapp-server : Copy service file] *************************************** | |
[0;32mok: [default] => {"changed": false, "checksum": "a0341b16f2d005be4300497c2ef6f740287204da", "dest": "/etc/systemd/system/webapp-server.service", "gid": 1099, "group": "webapp-server", "mode": "0644", "owner": "webapp-server", "path": "/etc/systemd/system/webapp-server.service", "size": 306, "state": "file", "uid": 1099} | |
TASK [webapp-server : Make sure a service is running] ************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "enabled": true, "name": "webapp-server", "state": "started", "status": {"ActiveEnterTimestamp": "Sat 2021-03-13 21:59:44 UTC", "ActiveEnterTimestampMonotonic": "350677321877", "ActiveExitTimestamp": "Sat 2021-03-13 21:59:44 UTC", "ActiveExitTimestampMonotonic": "350677311230", "ActiveState": "active", "After": "basic.target network.target system.slice systemd-journald.socket", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "yes", "AssertTimestamp": "Sat 2021-03-13 21:59:44 UTC", "AssertTimestampMonotonic": "350677320307", "Before": "shutdown.target multi-user.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "ConditionResult": "yes", "ConditionTimestamp": "Sat 2021-03-13 21:59:44 UTC", "ConditionTimestampMonotonic": "350677320306", "Conflicts": "shutdown.target", "ControlGroup": "/docker/cb00c34b221d10c44a7a2577017503c7ea18e2af33ebdf84fdd8b1326703dcf1/system.slice/webapp-server.service", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "Simple WebApp Server", "DevicePolicy": "auto", "EnvironmentFile": "/opt/webapp-server//conf/webapp-server.conf (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "4043", "ExecMainStartTimestamp": "Sat 2021-03-13 21:59:44 UTC", "ExecMainStartTimestampMonotonic": "350677321805", "ExecMainStatus": "0", "ExecStart": "{ path=/opt/webapp-server/bin/webapp-server ; argv[]=/opt/webapp-server//bin/webapp-server ; ignore_errors=no ; start_time=[Sat 2021-03-13 21:59:44 UTC] ; stop_time=[n/a] ; pid=4043 ; code=(null) ; status=0/0 }", "ExecStop": "{ path=/bin/kill ; argv[]=/bin/kill -s QUIT $MAINPID ; ignore_errors=no ; start_time=[Sat 2021-03-13 21:59:44 UTC] ; stop_time=[Sat 2021-03-13 21:59:44 UTC] ; pid=4042 ; code=exited ; status=0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/etc/systemd/system/webapp-server.service", "Group": "webapp-server", "GuessMainPID": "yes", "IOScheduling": "0", "Id": "webapp-server.service", "IgnoreOnIsolate": "no", "IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestamp": "Sat 2021-03-13 21:59:44 UTC", "InactiveEnterTimestampMonotonic": "350677319875", "InactiveExitTimestamp": "Sat 2021-03-13 21:59:44 UTC", "InactiveExitTimestampMonotonic": "350677321877", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "67108864", "LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "1048576", "LimitNPROC": "18446744073709551615", "LimitRSS": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "29790", "LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": "4043", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": "webapp-server.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "Requires": "basic.target", "Restart": "no", "RestartUSec": "100ms", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitInterval": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "running", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": "18446744073709551615", "TasksMax": "18446744073709551615", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "simple", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "enabled", "User": "webapp-server", "WantedBy": "multi-user.target", "Wants": "system.slice", "WatchdogTimestamp": "Sat 2021-03-13 21:59:44 UTC", "WatchdogTimestampMonotonic": "350677321847", "WatchdogUSec": "0"}} | |
TASK [webapp-server : Wait for webserver] ************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "elapsed": 1, "match_groupdict": {}, "match_groups": [], "path": null, "port": 8080, "search_regex": null, "state": "started"} | |
PLAY RECAP ********************************************************************* | |
[0;33mdefault : [0;32mok=15 [0;33mchanged=1 unreachable=0 failed=0 [0;36mskipped=1 rescued=0 ignored=0 | |
* About to connect() to localhost port 8080 (#0) | |
* Trying 127.0.0.1... | |
* Connected to localhost (127.0.0.1) port 8080 (#0) | |
> GET / HTTP/1.1 | |
> User-Agent: curl/7.29.0 | |
> Host: localhost:8080 | |
> Accept: */* | |
> | |
< HTTP/1.1 200 OK | |
< Expires: 0 | |
< Pragma: no-cache | |
< Date: Sat, 13 Mar 2021 22:00:27 GMT | |
< Content-Length: 196 | |
< Content-Type: text/plain; charset=utf-8 | |
< | |
{ [data not shown] | |
* Connection #0 to host localhost left intact | |
2021/03/13 22:01:55 ✗ [2.3 WebApp-Server Role (centos 7)] -> stress-test: changing application port | |
2021/03/13 22:01:55 Result: exit status 1 | |
2021/03/13 22:01:55 Output: | |
centos7 | |
52e52be675c528a7b24ba9ae978d4658910c9d08d8dafc2f2d8f3062f7001354 | |
[0;34mUsing /tmp/students-2/anton_antanovich/day2/2.3/ansible.cfg as config file | |
PLAY [all] ********************************************************************* | |
TASK [base : Check facts directory] ******************************************** | |
[0;33mchanged: [default] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": true, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/etc/ansible/facts.d", "size": 4096, "state": "directory", "uid": 0} | |
TASK [base : Gathering facts] ************************************************** | |
[0;32mok: [default] | |
TASK [base : epel-release installer] ******************************************* | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "changes": {"installed": ["wget"], "updated": [["iproute", "4.11.0-30.el7.x86_64 from base"], ["curl", "7.29.0-59.el7_9.1.x86_64 from updates"], ["sudo", "1.8.23-10.el7_9.1.x86_64 from updates"], ["epel-release", "7-13.noarch from epel"]]}, "msg": "", "rc": 0, "results": ["Loaded plugins: fastestmirror, ovl\nLoading mirror speeds from cached hostfile\n * base: mirror.datacenter.by\n * epel: mirror.datacenter.by\n * extras: mirror.datacenter.by\n * updates: mirror.datacenter.by\nResolving Dependencies\n--> Running transaction check\n---> Package curl.x86_64 0:7.29.0-51.el7 will be updated\n---> Package curl.x86_64 0:7.29.0-59.el7_9.1 will be an update\n--> Processing Dependency: libcurl = 7.29.0-59.el7_9.1 for package: curl-7.29.0-59.el7_9.1.x86_64\n---> Package epel-release.noarch 0:7-11 will be updated\n---> Package epel-release.noarch 0:7-13 will be an update\n---> Package iproute.x86_64 0:4.11.0-14.el7 will be updated\n---> Package iproute.x86_64 0:4.11.0-30.el7 will be an update\n---> Package sudo.x86_64 0:1.8.23-3.el7 will be updated\n---> Package sudo.x86_64 0:1.8.23-10.el7_9.1 will be an update\n---> Package wget.x86_64 0:1.14-18.el7_6.1 will be installed\n--> Running transaction check\n---> Package libcurl.x86_64 0:7.29.0-51.el7 will be updated\n---> Package libcurl.x86_64 0:7.29.0-59.el7_9.1 will be an update\n--> Processing Dependency: libssh2(x86-64) >= 1.8.0 for package: libcurl-7.29.0-59.el7_9.1.x86_64\n--> Running transaction check\n---> Package libssh2.x86_64 0:1.4.3-12.el7_6.2 will be updated\n---> Package libssh2.x86_64 0:1.8.0-4.el7 will be an update\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n wget x86_64 1.14-18.el7_6.1 base 547 k\nUpdating:\n curl x86_64 7.29.0-59.el7_9.1 updates 271 k\n epel-release noarch 7-13 epel 15 k\n iproute x86_64 4.11.0-30.el7 base 805 k\n sudo x86_64 1.8.23-10.el7_9.1 updates 843 k\nUpdating for dependencies:\n libcurl x86_64 7.29.0-59.el7_9.1 updates 223 k\n libssh2 x86_64 1.8.0-4.el7 base 88 k\n\nTransaction Summary\n================================================================================\nInstall 1 Package\nUpgrade 4 Packages (+2 Dependent packages)\n\nTotal download size: 2.7 M\nDownloading packages:\nNo Presto metadata available for base\nNo Presto metadata available for updates\n--------------------------------------------------------------------------------\nTotal 3.5 MB/s | 2.7 MB 00:00 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Updating : libssh2-1.8.0-4.el7.x86_64 1/13 \n Updating : libcurl-7.29.0-59.el7_9.1.x86_64 2/13 \n Updating : curl-7.29.0-59.el7_9.1.x86_64 3/13 \n Updating : epel-release-7-13.noarch 4/13 \n Updating : sudo-1.8.23-10.el7_9.1.x86_64 5/13 \n Updating : iproute-4.11.0-30.el7.x86_64 6/13 \n Installing : wget-1.14-18.el7_6.1.x86_64 7/13 \ninstall-info: No such file or directory for /usr/share/info/wget.info.gz\n Cleanup : curl-7.29.0-51.el7.x86_64 8/13 \n Cleanup : epel-release-7-11.noarch 9/13 \n Cleanup : libcurl-7.29.0-51.el7.x86_64 10/13 \n Cleanup : libssh2-1.4.3-12.el7_6.2.x86_64 11/13 \n Cleanup : sudo-1.8.23-3.el7.x86_64 12/13 \n Cleanup : iproute-4.11.0-14.el7.x86_64 13/13 \n Verifying : curl-7.29.0-59.el7_9.1.x86_64 1/13 \n Verifying : libssh2-1.8.0-4.el7.x86_64 2/13 \n Verifying : wget-1.14-18.el7_6.1.x86_64 3/13 \n Verifying : iproute-4.11.0-30.el7.x86_64 4/13 \n Verifying : sudo-1.8.23-10.el7_9.1.x86_64 5/13 \n Verifying : libcurl-7.29.0-59.el7_9.1.x86_64 6/13 \n Verifying : epel-release-7-13.noarch 7/13 \n Verifying : sudo-1.8.23-3.el7.x86_64 8/13 \n Verifying : epel-release-7-11.noarch 9/13 \n Verifying : libssh2-1.4.3-12.el7_6.2.x86_64 10/13 \n Verifying : curl-7.29.0-51.el7.x86_64 11/13 \n Verifying : iproute-4.11.0-14.el7.x86_64 12/13 \n Verifying : libcurl-7.29.0-51.el7.x86_64 13/13 \n\nInstalled:\n wget.x86_64 0:1.14-18.el7_6.1 \n\nUpdated:\n curl.x86_64 0:7.29.0-59.el7_9.1 epel-release.noarch 0:7-13 \n iproute.x86_64 0:4.11.0-30.el7 sudo.x86_64 0:1.8.23-10.el7_9.1 \n\nDependency Updated:\n libcurl.x86_64 0:7.29.0-59.el7_9.1 libssh2.x86_64 0:1.8.0-4.el7 \n\nComplete!\n"]} | |
TASK [base : python] *********************************************************** | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "changes": {"installed": ["python3", "python3-pip", "python-devel"]}, "msg": "", "rc": 0, "results": ["Loaded plugins: fastestmirror, ovl\nLoading mirror speeds from cached hostfile\n * base: mirror.datacenter.by\n * epel: mirror.datacenter.by\n * extras: mirror.datacenter.by\n * updates: mirror.datacenter.by\nResolving Dependencies\n--> Running transaction check\n---> Package python-devel.x86_64 0:2.7.5-90.el7 will be installed\n--> Processing Dependency: python(x86-64) = 2.7.5-90.el7 for package: python-devel-2.7.5-90.el7.x86_64\n--> Processing Dependency: python2-rpm-macros > 3-30 for package: python-devel-2.7.5-90.el7.x86_64\n--> Processing Dependency: python-rpm-macros > 3-30 for package: python-devel-2.7.5-90.el7.x86_64\n---> Package python3.x86_64 0:3.6.8-18.el7 will be installed\n--> Processing Dependency: python3-libs(x86-64) = 3.6.8-18.el7 for package: python3-3.6.8-18.el7.x86_64\n--> Processing Dependency: python3-setuptools for package: python3-3.6.8-18.el7.x86_64\n--> Processing Dependency: libpython3.6m.so.1.0()(64bit) for package: python3-3.6.8-18.el7.x86_64\n---> Package python3-pip.noarch 0:9.0.3-8.el7 will be installed\n--> Running transaction check\n---> Package python.x86_64 0:2.7.5-77.el7_6 will be updated\n---> Package python.x86_64 0:2.7.5-90.el7 will be an update\n--> Processing Dependency: python-libs(x86-64) = 2.7.5-90.el7 for package: python-2.7.5-90.el7.x86_64\n---> Package python-rpm-macros.noarch 0:3-34.el7 will be installed\n--> Processing Dependency: python-srpm-macros for package: python-rpm-macros-3-34.el7.noarch\n---> Package python2-rpm-macros.noarch 0:3-34.el7 will be installed\n---> Package python3-libs.x86_64 0:3.6.8-18.el7 will be installed\n--> Processing Dependency: libtirpc.so.1()(64bit) for package: python3-libs-3.6.8-18.el7.x86_64\n---> Package python3-setuptools.noarch 0:39.2.0-10.el7 will be installed\n--> Running transaction check\n---> Package libtirpc.x86_64 0:0.2.4-0.16.el7 will be installed\n---> Package python-libs.x86_64 0:2.7.5-77.el7_6 will be updated\n---> Package python-libs.x86_64 0:2.7.5-90.el7 will be an update\n---> Package python-srpm-macros.noarch 0:3-34.el7 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n python-devel x86_64 2.7.5-90.el7 updates 399 k\n python3 x86_64 3.6.8-18.el7 updates 70 k\n python3-pip noarch 9.0.3-8.el7 base 1.6 M\nInstalling for dependencies:\n libtirpc x86_64 0.2.4-0.16.el7 base 89 k\n python-rpm-macros noarch 3-34.el7 base 9.1 k\n python-srpm-macros noarch 3-34.el7 base 8.8 k\n python2-rpm-macros noarch 3-34.el7 base 8.1 k\n python3-libs x86_64 3.6.8-18.el7 updates 6.9 M\n python3-setuptools noarch 39.2.0-10.el7 base 629 k\nUpdating for dependencies:\n python x86_64 2.7.5-90.el7 updates 96 k\n python-libs x86_64 2.7.5-90.el7 updates 5.6 M\n\nTransaction Summary\n================================================================================\nInstall 3 Packages (+6 Dependent packages)\nUpgrade ( 2 Dependent packages)\n\nTotal download size: 15 M\nDownloading packages:\nNo Presto metadata available for updates\n--------------------------------------------------------------------------------\nTotal 12 MB/s | 15 MB 00:01 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Updating : python-libs-2.7.5-90.el7.x86_64 1/13 \n Updating : python-2.7.5-90.el7.x86_64 2/13 \n Installing : python-srpm-macros-3-34.el7.noarch 3/13 \n Installing : python-rpm-macros-3-34.el7.noarch 4/13 \n Installing : python2-rpm-macros-3-34.el7.noarch 5/13 \n Installing : libtirpc-0.2.4-0.16.el7.x86_64 6/13 \n Installing : python3-setuptools-39.2.0-10.el7.noarch 7/13 \n Installing : python3-pip-9.0.3-8.el7.noarch 8/13 \n Installing : python3-3.6.8-18.el7.x86_64 9/13 \n Installing : python3-libs-3.6.8-18.el7.x86_64 10/13 \n Installing : python-devel-2.7.5-90.el7.x86_64 11/13 \n Cleanup : python-2.7.5-77.el7_6.x86_64 12/13 \n Cleanup : python-libs-2.7.5-77.el7_6.x86_64 13/13 \n Verifying : libtirpc-0.2.4-0.16.el7.x86_64 1/13 \n Verifying : python2-rpm-macros-3-34.el7.noarch 2/13 \n Verifying : python3-libs-3.6.8-18.el7.x86_64 3/13 \n Verifying : python-devel-2.7.5-90.el7.x86_64 4/13 \n Verifying : python-2.7.5-90.el7.x86_64 5/13 \n Verifying : python3-setuptools-39.2.0-10.el7.noarch 6/13 \n Verifying : python-srpm-macros-3-34.el7.noarch 7/13 \n Verifying : python-rpm-macros-3-34.el7.noarch 8/13 \n Verifying : python3-3.6.8-18.el7.x86_64 9/13 \n Verifying : python3-pip-9.0.3-8.el7.noarch 10/13 \n Verifying : python-libs-2.7.5-90.el7.x86_64 11/13 \n Verifying : python-2.7.5-77.el7_6.x86_64 12/13 \n Verifying : python-libs-2.7.5-77.el7_6.x86_64 13/13 \n\nInstalled:\n python-devel.x86_64 0:2.7.5-90.el7 python3.x86_64 0:3.6.8-18.el7 \n python3-pip.noarch 0:9.0.3-8.el7 \n\nDependency Installed:\n libtirpc.x86_64 0:0.2.4-0.16.el7 \n python-rpm-macros.noarch 0:3-34.el7 \n python-srpm-macros.noarch 0:3-34.el7 \n python2-rpm-macros.noarch 0:3-34.el7 \n python3-libs.x86_64 0:3.6.8-18.el7 \n python3-setuptools.noarch 0:39.2.0-10.el7 \n\nDependency Updated:\n python.x86_64 0:2.7.5-90.el7 python-libs.x86_64 0:2.7.5-90.el7 \n\nComplete!\n"]} | |
TASK [base : latest pip] ******************************************************* | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "cmd": ["pip", "install", "--upgrade", "pip"], "delta": "0:00:04.560479", "end": "2021-03-13 22:01:27.791356", "rc": 0, "start": "2021-03-13 22:01:23.230877", "stderr": "DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.", "stderr_lines": ["DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7."], "stdout": "Collecting pip\n Downloading https://files.pythonhosted.org/packages/27/79/8a850fe3496446ff0d584327ae44e7500daf6764ca1a382d2d02789accf7/pip-20.3.4-py2.py3-none-any.whl (1.5MB)\nInstalling collected packages: pip\n Found existing installation: pip 19.1\n Uninstalling pip-19.1:\n Successfully uninstalled pip-19.1\nSuccessfully installed pip-20.3.4", "stdout_lines": ["Collecting pip", " Downloading https://files.pythonhosted.org/packages/27/79/8a850fe3496446ff0d584327ae44e7500daf6764ca1a382d2d02789accf7/pip-20.3.4-py2.py3-none-any.whl (1.5MB)", "Installing collected packages: pip", " Found existing installation: pip 19.1", " Uninstalling pip-19.1:", " Successfully uninstalled pip-19.1", "Successfully installed pip-20.3.4"]} | |
TASK [base : Install pymysql] ************************************************** | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "cmd": ["/bin/pip2", "install", "pymysql"], "name": ["pymysql"], "requirements": null, "state": "present", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.\n", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Collecting pymysql\n Downloading PyMySQL-0.10.1-py2.py3-none-any.whl (47 kB)\nInstalling collected packages: pymysql\nSuccessfully installed pymysql-0.10.1\n", "stdout_lines": ["Collecting pymysql", " Downloading PyMySQL-0.10.1-py2.py3-none-any.whl (47 kB)", "Installing collected packages: pymysql", "Successfully installed pymysql-0.10.1"], "version": null, "virtualenv": null} | |
TASK [user : Create group webapp-server] *************************************** | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "gid": 1099, "name": "webapp-server", "state": "present", "system": false} | |
TASK [user : Create user webapp-server] **************************************** | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "comment": "", "create_home": true, "group": 1099, "home": "/opt/webapp-server/", "name": "webapp-server", "shell": "/bin/sh", "state": "present", "stderr": "useradd: warning: the home directory already exists.\nNot copying any file from skel directory into it.\n", "stderr_lines": ["useradd: warning: the home directory already exists.", "Not copying any file from skel directory into it."], "system": false, "uid": 1099} | |
TASK [user : Give sudo privileges] ********************************************* | |
[0;36mskipping: [default] => {"changed": false, "skip_reason": "Conditional result was False"} | |
TASK [webapp-server : Make bin folder] ***************************************** | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "gid": 1099, "group": "webapp-server", "mode": "0755", "owner": "webapp-server", "path": "/opt/webapp-server//bin", "size": 4096, "state": "directory", "uid": 1099} | |
TASK [webapp-server : Make conf folder] **************************************** | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "gid": 1099, "group": "webapp-server", "mode": "0755", "owner": "webapp-server", "path": "/opt/webapp-server//conf", "size": 4096, "state": "directory", "uid": 1099} | |
TASK [webapp-server : Download executable file] ******************************** | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "checksum_dest": null, "checksum_src": "28f105a4ed1478f27001141888cb86efc7ace7aa", "dest": "/opt/webapp-server//bin/webapp-server", "elapsed": 2, "gid": 1099, "group": "webapp-server", "md5sum": "66e5a7366408e9db471e3e9586e01708", "mode": "0750", "msg": "OK (6213632 bytes)", "owner": "webapp-server", "size": 6213632, "src": "/root/.ansible/tmp/ansible-moduletmp-1615672894.53-LV69tQ/tmplIfHwJ", "state": "file", "status_code": 200, "uid": 1099, "url": "https://playpit-labs-assets.s3-eu-west-1.amazonaws.com/webapp-server/webapp-server"} | |
TASK [webapp-server : Copy configuration files] ******************************** | |
[0;33mchanged: [default] => {"changed": true, "checksum": "02ffebc7e96785d1c67ed1b06daa4b330866fecb", "dest": "/opt/webapp-server//conf/webapp-server.conf", "gid": 1099, "group": "webapp-server", "md5sum": "6160a19f6300d7f7cf732a78a8443a6e", "mode": "0644", "owner": "webapp-server", "size": 165, "src": "/root/.ansible/tmp/ansible_mitogen_action_1c648e6ae64ab009/source", "state": "file", "uid": 1099} | |
TASK [webapp-server : Copy service file] *************************************** | |
[0;33mchanged: [default] => {"changed": true, "checksum": "a0341b16f2d005be4300497c2ef6f740287204da", "dest": "/etc/systemd/system/webapp-server.service", "gid": 1099, "group": "webapp-server", "md5sum": "b67b06556711f324784b56dcfdc8b007", "mode": "0644", "owner": "webapp-server", "size": 306, "src": "/root/.ansible/tmp/ansible_mitogen_action_69741949dab7adc2/source", "state": "file", "uid": 1099} | |
TASK [webapp-server : Make sure a service is running] ************************** | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "enabled": true, "name": "webapp-server", "state": "started", "status": {"ActiveEnterTimestampMonotonic": "0", "ActiveExitTimestampMonotonic": "0", "ActiveState": "inactive", "After": "systemd-journald.socket basic.target network.target system.slice", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "no", "AssertTimestampMonotonic": "0", "Before": "shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "ConditionResult": "no", "ConditionTimestampMonotonic": "0", "Conflicts": "shutdown.target", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "Simple WebApp Server", "DevicePolicy": "auto", "EnvironmentFile": "/opt/webapp-server//conf/webapp-server.conf (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "0", "ExecMainStartTimestampMonotonic": "0", "ExecMainStatus": "0", "ExecStart": "{ path=/opt/webapp-server/bin/webapp-server ; argv[]=/opt/webapp-server//bin/webapp-server ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "ExecStop": "{ path=/bin/kill ; argv[]=/bin/kill -s QUIT $MAINPID ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/etc/systemd/system/webapp-server.service", "Group": "webapp-server", "GuessMainPID": "yes", "IOScheduling": "0", "Id": "webapp-server.service", "IgnoreOnIsolate": "no", "IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestampMonotonic": "0", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "67108864", "LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "1048576", "LimitNPROC": "18446744073709551615", "LimitRSS": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "29790", "LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": "0", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": "webapp-server.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "Requires": "basic.target", "Restart": "no", "RestartUSec": "100ms", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitInterval": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "dead", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": "18446744073709551615", "TasksMax": "18446744073709551615", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "simple", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "disabled", "User": "webapp-server", "Wants": "system.slice", "WatchdogTimestampMonotonic": "0", "WatchdogUSec": "0"}} | |
TASK [webapp-server : Wait for webserver] ************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "elapsed": 1, "match_groupdict": {}, "match_groups": [], "path": null, "port": 8081, "search_regex": null, "state": "started"} | |
RUNNING HANDLER [webapp-server : restart webserver] **************************** | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "name": "webapp-server", "state": "started", "status": {"ActiveEnterTimestamp": "Sat 2021-03-13 22:01:42 UTC", "ActiveEnterTimestampMonotonic": "350795306295", "ActiveExitTimestampMonotonic": "0", "ActiveState": "active", "After": "systemd-journald.socket basic.target system.slice network.target", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "yes", "AssertTimestamp": "Sat 2021-03-13 22:01:42 UTC", "AssertTimestampMonotonic": "350795299961", "Before": "shutdown.target multi-user.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "ConditionResult": "yes", "ConditionTimestamp": "Sat 2021-03-13 22:01:42 UTC", "ConditionTimestampMonotonic": "350795299961", "Conflicts": "shutdown.target", "ControlGroup": "/docker/52e52be675c528a7b24ba9ae978d4658910c9d08d8dafc2f2d8f3062f7001354/system.slice/webapp-server.service", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "Simple WebApp Server", "DevicePolicy": "auto", "EnvironmentFile": "/opt/webapp-server//conf/webapp-server.conf (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "2442", "ExecMainStartTimestamp": "Sat 2021-03-13 22:01:42 UTC", "ExecMainStartTimestampMonotonic": "350795303997", "ExecMainStatus": "0", "ExecStart": "{ path=/opt/webapp-server/bin/webapp-server ; argv[]=/opt/webapp-server//bin/webapp-server ; ignore_errors=no ; start_time=[Sat 2021-03-13 22:01:42 UTC] ; stop_time=[n/a] ; pid=2442 ; code=(null) ; status=0/0 }", "ExecStop": "{ path=/bin/kill ; argv[]=/bin/kill -s QUIT $MAINPID ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/etc/systemd/system/webapp-server.service", "Group": "webapp-server", "GuessMainPID": "yes", "IOScheduling": "0", "Id": "webapp-server.service", "IgnoreOnIsolate": "no", "IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestamp": "Sat 2021-03-13 22:01:42 UTC", "InactiveExitTimestampMonotonic": "350795306295", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "67108864", "LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "1048576", "LimitNPROC": "18446744073709551615", "LimitRSS": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "29790", "LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": "2442", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": "webapp-server.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "Requires": "basic.target", "Restart": "no", "RestartUSec": "100ms", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitInterval": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "running", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": "18446744073709551615", "TasksMax": "18446744073709551615", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "simple", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "enabled", "User": "webapp-server", "WantedBy": "multi-user.target", "Wants": "system.slice", "WatchdogTimestamp": "Sat 2021-03-13 22:01:42 UTC", "WatchdogTimestampMonotonic": "350795306257", "WatchdogUSec": "0"}} | |
PLAY RECAP ********************************************************************* | |
[0;33mdefault : [0;32mok=16 [0;33mchanged=14 unreachable=0 failed=0 [0;36mskipped=1 rescued=0 ignored=0 | |
* About to connect() to localhost port 8081 (#0) | |
* Trying 127.0.0.1... | |
* Connected to localhost (127.0.0.1) port 8081 (#0) | |
> GET / HTTP/1.1 | |
> User-Agent: curl/7.29.0 | |
> Host: localhost:8081 | |
> Accept: */* | |
> | |
< HTTP/1.1 200 OK | |
< Expires: 0 | |
< Pragma: no-cache | |
< Date: Sat, 13 Mar 2021 22:01:55 GMT | |
< Content-Length: 196 | |
< Content-Type: text/plain; charset=utf-8 | |
< | |
{ [data not shown] | |
* Connection #0 to host localhost left intact | |
2021/03/13 22:03:23 ✓ [2.3 WebApp-Server Role (centos 7)] => stress-test: changing student name (1), 1m27.869s | |
2021/03/13 22:04:48 ✓ [2.3 WebApp-Server Role (centos 7)] => stress-test: changing application home dir (1), 1m25.584s | |
2021/03/13 22:06:00 ✓ [2.3 WebApp-Server Role (centos 7)] => rollout (Not ROOT) (5), 1m11.5s | |
2021/03/13 22:06:27 ✗ [2.3 WebApp-Server Role (centos 7)] -> idempotancy check (Not ROOT) | |
2021/03/13 22:06:27 Result: exit status 1 | |
2021/03/13 22:06:27 Output: | |
(run, /tmp/students-2/anton_antanovich/day2/2.3) => ansible-playbook testing-role-webapp-server.yml -i default, -e ansible_host=centos7 -v -u devops | |
rc: 0 | |
output: | | |
[0;34mUsing /tmp/students-2/anton_antanovich/day2/2.3/ansible.cfg as config file | |
PLAY [all] ********************************************************************* | |
TASK [base : Check facts directory] ******************************************** | |
[0;32mok: [default] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/etc/ansible/facts.d", "size": 4096, "state": "directory", "uid": 0} | |
TASK [base : Gathering facts] ************************************************** | |
[0;32mok: [default] | |
TASK [base : epel-release installer] ******************************************* | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "changes": {"installed": [], "updated": []}, "msg": "", "rc": 0, "results": ["All packages providing epel-release are up to date", "All packages providing curl are up to date", "All packages providing wget are up to date", "All packages providing sudo are up to date", "All packages providing iproute are up to date", ""]} | |
TASK [base : python] *********************************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "msg": "", "rc": 0, "results": ["python3-3.6.8-18.el7.x86_64 providing python3 is already installed", "python3-pip-9.0.3-8.el7.noarch providing python3-pip is already installed", "python-devel-2.7.5-90.el7.x86_64 providing python-devel is already installed"]} | |
TASK [base : latest pip] ******************************************************* | |
[0;33mchanged: [default] => {"ansible_facts": {}, "changed": true, "cmd": ["pip", "install", "--upgrade", "pip"], "delta": "0:00:01.334944", "end": "2021-03-13 22:06:14.825168", "rc": 0, "start": "2021-03-13 22:06:13.490224", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)", "stdout_lines": ["Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)"]} | |
TASK [base : Install pymysql] ************************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "cmd": ["/bin/pip2", "install", "pymysql"], "name": ["pymysql"], "requirements": null, "state": "present", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.\n", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)\n", "stdout_lines": ["Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)"], "version": null, "virtualenv": null} | |
TASK [user : Create group webapp-server] *************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "gid": 1099, "name": "webapp-server", "state": "present", "system": false} | |
TASK [user : Create user webapp-server] **************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "append": false, "changed": false, "comment": "", "group": 1099, "home": "/opt/webapp-server/", "move_home": false, "name": "webapp-server", "shell": "/bin/sh", "state": "present", "uid": 1099} | |
TASK [user : Give sudo privileges] ********************************************* | |
[0;36mskipping: [default] => {"changed": false, "skip_reason": "Conditional result was False"} | |
TASK [webapp-server : Make bin folder] ***************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "gid": 1099, "group": "webapp-server", "mode": "0755", "owner": "webapp-server", "path": "/opt/webapp-server//bin", "size": 4096, "state": "directory", "uid": 1099} | |
TASK [webapp-server : Make conf folder] **************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "gid": 1099, "group": "webapp-server", "mode": "0755", "owner": "webapp-server", "path": "/opt/webapp-server//conf", "size": 4096, "state": "directory", "uid": 1099} | |
TASK [webapp-server : Download executable file] ******************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "checksum_dest": null, "checksum_src": null, "dest": "/opt/webapp-server//bin/webapp-server", "elapsed": 0, "gid": 1099, "group": "webapp-server", "mode": "0750", "msg": "file already exists", "owner": "webapp-server", "size": 6213632, "state": "file", "uid": 1099, "url": "https://playpit-labs-assets.s3-eu-west-1.amazonaws.com/webapp-server/webapp-server"} | |
TASK [webapp-server : Copy configuration files] ******************************** | |
[0;32mok: [default] => {"changed": false, "checksum": "b1fac666bd0b94c02bfa937a0de22e4f3ae5d112", "dest": "/opt/webapp-server//conf/webapp-server.conf", "gid": 1099, "group": "webapp-server", "mode": "0644", "owner": "webapp-server", "path": "/opt/webapp-server//conf/webapp-server.conf", "size": 165, "state": "file", "uid": 1099} | |
TASK [webapp-server : Copy service file] *************************************** | |
[0;32mok: [default] => {"changed": false, "checksum": "a0341b16f2d005be4300497c2ef6f740287204da", "dest": "/etc/systemd/system/webapp-server.service", "gid": 1099, "group": "webapp-server", "mode": "0644", "owner": "webapp-server", "path": "/etc/systemd/system/webapp-server.service", "size": 306, "state": "file", "uid": 1099} | |
TASK [webapp-server : Make sure a service is running] ************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "enabled": true, "name": "webapp-server", "state": "started", "status": {"ActiveEnterTimestamp": "Sat 2021-03-13 22:05:59 UTC", "ActiveEnterTimestampMonotonic": "351052750923", "ActiveExitTimestamp": "Sat 2021-03-13 22:05:59 UTC", "ActiveExitTimestampMonotonic": "351052740969", "ActiveState": "active", "After": "network.target basic.target system.slice systemd-journald.socket", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "yes", "AssertTimestamp": "Sat 2021-03-13 22:05:59 UTC", "AssertTimestampMonotonic": "351052749477", "Before": "multi-user.target shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "ConditionResult": "yes", "ConditionTimestamp": "Sat 2021-03-13 22:05:59 UTC", "ConditionTimestampMonotonic": "351052749477", "Conflicts": "shutdown.target", "ControlGroup": "/docker/0d7ce0a15d4423fa72f2a180423468312a59e1fed4bae5997efc60274e1bd7c7/system.slice/webapp-server.service", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "Simple WebApp Server", "DevicePolicy": "auto", "EnvironmentFile": "/opt/webapp-server//conf/webapp-server.conf (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "2413", "ExecMainStartTimestamp": "Sat 2021-03-13 22:05:59 UTC", "ExecMainStartTimestampMonotonic": "351052750847", "ExecMainStatus": "0", "ExecStart": "{ path=/opt/webapp-server/bin/webapp-server ; argv[]=/opt/webapp-server//bin/webapp-server ; ignore_errors=no ; start_time=[Sat 2021-03-13 22:05:59 UTC] ; stop_time=[n/a] ; pid=2413 ; code=(null) ; status=0/0 }", "ExecStop": "{ path=/bin/kill ; argv[]=/bin/kill -s QUIT $MAINPID ; ignore_errors=no ; start_time=[Sat 2021-03-13 22:05:59 UTC] ; stop_time=[Sat 2021-03-13 22:05:59 UTC] ; pid=2412 ; code=exited ; status=0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/etc/systemd/system/webapp-server.service", "Group": "webapp-server", "GuessMainPID": "yes", "IOScheduling": "4", "Id": "webapp-server.service", "IgnoreOnIsolate": "no", "IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestamp": "Sat 2021-03-13 22:05:59 UTC", "InactiveEnterTimestampMonotonic": "351052748748", "InactiveExitTimestamp": "Sat 2021-03-13 22:05:59 UTC", "InactiveExitTimestampMonotonic": "351052750923", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "67108864", "LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "1048576", "LimitNPROC": "18446744073709551615", "LimitRSS": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "29790", "LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": "2413", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": "webapp-server.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "Requires": "basic.target", "Restart": "no", "RestartUSec": "100ms", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitInterval": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "running", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": "18446744073709551615", "TasksMax": "18446744073709551615", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "simple", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "enabled", "User": "webapp-server", "WantedBy": "multi-user.target", "Wants": "system.slice", "WatchdogTimestamp": "Sat 2021-03-13 22:05:59 UTC", "WatchdogTimestampMonotonic": "351052750892", "WatchdogUSec": "0"}} | |
TASK [webapp-server : Wait for webserver] ************************************** | |
[0;32mok: [default] => {"ansible_facts": {}, "changed": false, "elapsed": 1, "match_groupdict": {}, "match_groups": [], "path": null, "port": 8080, "search_regex": null, "state": "started"} | |
PLAY RECAP ********************************************************************* | |
[0;33mdefault : [0;32mok=15 [0;33mchanged=1 unreachable=0 failed=0 [0;36mskipped=1 rescued=0 ignored=0 | |
Stdout Assertion Failed (Partial, 'changed=0') | |
2021/03/13 22:06:29 ----------------------------------------------------------------------------------- | |
2021/03/13 22:06:29 Tests Summary: | |
2021/03/13 22:06:29 11 (of 17) tests passed, 6 tests failed; rated as 57.58% | |
2021/03/13 22:06:29 | |
2021/03/13 22:06:29 Time Spent: 7m59.035s | |
2021/03/13 22:06:29 ----------------------------------------------------------------------------------- | |
name: anton_antanovich, master/849acf1 @ 2021-03-11 08:42:23 +0000 | |
2021/03/13 22:06:29 config: tests/mysqldb.yml | |
2021/03/13 22:06:29 verbosity: 2 | |
2021/03/13 22:06:29 ----------------------------------------------------------------------------------- | |
2021/03/13 22:06:29 Running '2.3 MysqlDB Role (CentOS 7)', 1..17 tests | |
2021/03/13 22:06:29 ----------------------------------------------------------------------------------- | |
2021/03/13 22:06:35 ✓ [2.3 MysqlDB Role (CentOS 7)] => 'mysql_db' role linter (1), 4.275s | |
2021/03/13 22:06:37 ✓ [2.3 MysqlDB Role (CentOS 7)] => 'mysql_db_user' role linter (1), 2.558s | |
2021/03/13 22:06:38 ✓ [2.3 MysqlDB Role (CentOS 7)] => playbook syntax check (1), 857ms | |
2021/03/13 22:10:41 ✓ [2.3 MysqlDB Role (CentOS 7)] => running role-mysqldb.yml playbook (1), 4m2.699s | |
2021/03/13 22:15:48 ✓ [2.3 MysqlDB Role (CentOS 7)] => apply 'mysql_db' role (1), 5m6.216s | |
2021/03/13 22:16:11 ✗ [2.3 MysqlDB Role (CentOS 7)] -> apply 'mysql_db' role again | |
2021/03/13 22:16:11 Result: exit status 1 | |
2021/03/13 22:16:11 Output: | |
[0;34mUsing /tmp/students-2/anton_antanovich/day2/2.3/ansible.cfg as config file | |
PLAY [db] ********************************************************************** | |
TASK [base : Check facts directory state=directory, path=/etc/ansible/facts.d, recurse=True] *** | |
[0;32mok: [db] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/etc/ansible/facts.d", "size": 4096, "state": "directory", "uid": 0} | |
TASK [base : Gathering facts fact_path=/etc/ansible/facts.d] ******************* | |
[0;32mok: [db] | |
TASK [base : epel-release installer name=epel-release, curl, wget, sudo, iproute, state=latest] *** | |
[0;32mok: [db] => {"ansible_facts": {}, "changed": false, "changes": {"installed": [], "updated": []}, "msg": "", "rc": 0, "results": ["All packages providing epel-release are up to date", "All packages providing curl are up to date", "All packages providing wget are up to date", "All packages providing sudo are up to date", "All packages providing iproute are up to date", ""]} | |
TASK [base : python name=python3, python3-pip, python-devel] ******************* | |
[0;32mok: [db] => {"ansible_facts": {}, "changed": false, "msg": "", "rc": 0, "results": ["python3-3.6.8-18.el7.x86_64 providing python3 is already installed", "python3-pip-9.0.3-8.el7.noarch providing python3-pip is already installed", "python-devel-2.7.5-90.el7.x86_64 providing python-devel is already installed"]} | |
TASK [base : latest pip _raw_params=pip install --upgrade pip] ***************** | |
[0;33mchanged: [db] => {"ansible_facts": {}, "changed": true, "cmd": ["pip", "install", "--upgrade", "pip"], "delta": "0:00:01.720369", "end": "2021-03-13 22:16:04.192907", "rc": 0, "start": "2021-03-13 22:16:02.472538", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)", "stdout_lines": ["Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)"]} | |
TASK [base : Install pymysql name=pymysql, state=present] ********************** | |
[0;32mok: [db] => {"ansible_facts": {}, "changed": false, "cmd": ["/bin/pip2", "install", "pymysql"], "name": ["pymysql"], "requirements": null, "state": "present", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.\n", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)\n", "stdout_lines": ["Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)"], "version": null, "virtualenv": null} | |
TASK [mysql_db : Add rpm gpg key state=present, key=https://repo.mysql.com/RPM-GPG-KEY-mysql] *** | |
[0;32mok: [db] => {"ansible_facts": {}, "changed": false} | |
TASK [mysql_db : RPM install name=https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm, state=present] *** | |
[0;32mok: [db] => {"ansible_facts": {}, "changed": false, "msg": "", "rc": 0, "results": ["mysql80-community-release-el7-3.noarch providing /root/.ansible/tmp/ansible-moduletmp-1615673768.58-tRkYy3/mysql80-community-release-el7-3.noarchohLbNp.rpm is already installed"]} | |
TASK [mysql_db : Install package name=['mysql-community-server'], enablerepo=mysql80-community] *** | |
[0;32mok: [db] => {"ansible_facts": {}, "changed": false, "msg": "", "rc": 0, "results": ["mysql-community-server-8.0.23-1.el7.x86_64 providing mysql-community-server is already installed"]} | |
TASK [mysql_db : initialize mysql without a root password _raw_params=mysqld --initialize-insecure --user={{ mysql_server_user }}] *** | |
[0;36mskipping: [db] => {"changed": false, "skip_reason": "Conditional result was False"} | |
TASK [mysql_db : start mysqld name=mysqld, state=started, enabled=True] ******** | |
[0;36mskipping: [db] => {"changed": false, "skip_reason": "Conditional result was False"} | |
TASK [mysql_db : Wait for mysql 5 sec... port=3306, delay=5] ******************* | |
[0;36mskipping: [db] => {"changed": false, "skip_reason": "Conditional result was False"} | |
TASK [mysql_db : Set root user password name=root, host=localhost, password={{ mysqldb_root_password }}, check_implicit_admin=True, state=present] *** | |
[0;36mskipping: [db] => {"changed": false, "skip_reason": "Conditional result was False"} | |
TASK [mysql_db : start mysqld name=mysqld, state=started, enabled=True] ******** | |
[0;32mok: [db] => {"ansible_facts": {}, "changed": false, "enabled": true, "name": "mysqld", "state": "started", "status": {"ActiveEnterTimestamp": "Sat 2021-03-13 22:15:39 UTC", "ActiveEnterTimestampMonotonic": "351632476324", "ActiveExitTimestampMonotonic": "0", "ActiveState": "active", "After": "system.slice basic.target systemd-journald.socket syslog.target network.target", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "yes", "AssertTimestamp": "Sat 2021-03-13 22:15:37 UTC", "AssertTimestampMonotonic": "351630121306", "Before": "shutdown.target multi-user.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "ConditionResult": "yes", "ConditionTimestamp": "Sat 2021-03-13 22:15:37 UTC", "ConditionTimestampMonotonic": "351630121305", "Conflicts": "shutdown.target", "ControlGroup": "/docker/ca3980cc0b8afb82f293dc5fda3f7b9965cd36770f46309abe2e90bf5a6d92a8/system.slice/mysqld.service", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "MySQL Server", "DevicePolicy": "auto", "Documentation": "man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html", "Environment": "MYSQLD_PARENT_PID=1", "EnvironmentFile": "/etc/sysconfig/mysql (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "7685", "ExecMainStartTimestamp": "Sat 2021-03-13 22:15:37 UTC", "ExecMainStartTimestampMonotonic": "351630211070", "ExecMainStatus": "0", "ExecStart": "{ path=/usr/sbin/mysqld ; argv[]=/usr/sbin/mysqld $MYSQLD_OPTS ; ignore_errors=no ; start_time=[Sat 2021-03-13 22:15:37 UTC] ; stop_time=[n/a] ; pid=7685 ; code=(null) ; status=0/0 }", "ExecStartPre": "{ path=/usr/bin/mysqld_pre_systemd ; argv[]=/usr/bin/mysqld_pre_systemd ; ignore_errors=no ; start_time=[Sat 2021-03-13 22:15:37 UTC] ; stop_time=[Sat 2021-03-13 22:15:37 UTC] ; pid=7664 ; code=exited ; status=0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/usr/lib/systemd/system/mysqld.service", "Group": "mysql", "GuessMainPID": "yes", "IOScheduling": "0", "Id": "mysqld.service", "IgnoreOnIsolate": "no", "IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestamp": "Sat 2021-03-13 22:15:37 UTC", "InactiveExitTimestampMonotonic": "351630128748", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "67108864", "LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "10000", "LimitNPROC": "18446744073709551615", "LimitRSS": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "29790", "LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": "7685", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": "mysqld.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "main", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "yes", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "Requires": "basic.target", "Restart": "on-failure", "RestartUSec": "100ms", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitInterval": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StatusErrno": "0", "StatusText": "Server is operational", "StopWhenUnneeded": "no", "SubState": "running", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": "18446744073709551615", "TasksMax": "18446744073709551615", "TimeoutStartUSec": "0", "TimeoutStopUSec": "0", "TimerSlackNSec": "50000", "Transient": "no", "Type": "notify", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "enabled", "User": "mysql", "WantedBy": "multi-user.target", "Wants": "system.slice", "WatchdogTimestamp": "Sat 2021-03-13 22:15:39 UTC", "WatchdogTimestampMonotonic": "351632476263", "WatchdogUSec": "0"}} | |
PLAY RECAP ********************************************************************* | |
[0;33mdb : [0;32mok=10 [0;33mchanged=1 unreachable=0 failed=0 [0;36mskipped=4 rescued=0 ignored=0 | |
2021-03-13 22:16:11,037 p=12241 u=root n=ansible | db : ok=10 changed=1 unreachable=0 failed=0 skipped=4 rescued=0 ignored=0 | |
2021/03/13 22:16:16 ✓ [2.3 MysqlDB Role (CentOS 7)] => apply 'mysql_db_user' role (1), 5.733s | |
2021/03/13 22:16:24 ✓ [2.3 MysqlDB Role (CentOS 7)] => apply 'mysql_db_user' role again (1), 7.255s | |
2021/03/13 22:16:24 ✓ [2.3 MysqlDB Role (CentOS 7)] => db service is enabled (1), 313ms | |
2021/03/13 22:16:24 ✓ [2.3 MysqlDB Role (CentOS 7)] => db service is active (1), 252ms | |
2021/03/13 22:16:25 ✓ [2.3 MysqlDB Role (CentOS 7)] => db service is running on 3306 (1), 267ms | |
2021/03/13 22:16:25 ✓ [2.3 MysqlDB Role (CentOS 7)] => db root password set (1), 209ms | |
2021/03/13 22:16:25 ✓ [2.3 MysqlDB Role (CentOS 7)] => custom db user (non-root) created (1), 380ms | |
2021/03/13 22:21:50 ✓ [2.3 MysqlDB Role (CentOS 7)] => apply 'mysql_db' role (Not ROOT) (1), 5m24.427s | |
2021/03/13 22:22:17 ✗ [2.3 MysqlDB Role (CentOS 7)] -> apply 'mysql_db' role (Not ROOT) again | |
2021/03/13 22:22:17 Result: exit status 1 | |
2021/03/13 22:22:17 Output: | |
PLAY [db] ********************************************************************** | |
TASK [base : Check facts directory] ******************************************** | |
[0;32mok: [db] | |
TASK [base : Gathering facts] ************************************************** | |
[0;32mok: [db] | |
TASK [base : epel-release installer] ******************************************* | |
[0;32mok: [db] | |
TASK [base : python] *********************************************************** | |
[0;32mok: [db] | |
TASK [base : latest pip] ******************************************************* | |
[0;33mchanged: [db] | |
TASK [base : Install pymysql] ************************************************** | |
[0;32mok: [db] | |
TASK [mysql_db : Add rpm gpg key] ********************************************** | |
[0;32mok: [db] | |
TASK [mysql_db : RPM install] ************************************************** | |
[0;32mok: [db] | |
TASK [mysql_db : Install package] ********************************************** | |
[0;32mok: [db] | |
TASK [mysql_db : initialize mysql without a root password] ********************* | |
[0;36mskipping: [db] | |
TASK [mysql_db : start mysqld] ************************************************* | |
[0;36mskipping: [db] | |
TASK [mysql_db : Wait for mysql 5 sec...] ************************************** | |
[0;36mskipping: [db] | |
TASK [mysql_db : Set root user password] *************************************** | |
[0;36mskipping: [db] | |
TASK [mysql_db : start mysqld] ************************************************* | |
[0;32mok: [db] | |
PLAY RECAP ********************************************************************* | |
[0;33mdb : [0;32mok=10 [0;33mchanged=1 unreachable=0 failed=0 [0;36mskipped=4 rescued=0 ignored=0 | |
2021-03-13 22:22:17,303 p=13883 u=root n=ansible | db : ok=10 changed=1 unreachable=0 failed=0 skipped=4 rescued=0 ignored=0 | |
2021/03/13 22:22:24 ✓ [2.3 MysqlDB Role (CentOS 7)] => apply 'mysql_db_user' role (Not ROOT) (1), 6.738s | |
2021/03/13 22:22:31 ✓ [2.3 MysqlDB Role (CentOS 7)] => apply 'mysql_db_user' role (Not ROOT) again (1), 7.012s | |
2021/03/13 22:22:32 ----------------------------------------------------------------------------------- | |
2021/03/13 22:22:32 Tests Summary: | |
2021/03/13 22:22:32 15 (of 17) tests passed, 2 tests failed; rated as 88.24% | |
2021/03/13 22:22:32 | |
2021/03/13 22:22:32 Time Spent: 16m2.679s | |
2021/03/13 22:22:32 ----------------------------------------------------------------------------------- | |
name: anton_antanovich, master/849acf1 @ 2021-03-11 08:42:23 +0000 | |
2021/03/13 22:22:32 config: tests/mysqldb-check.yml | |
2021/03/13 22:22:32 verbosity: 2 | |
2021/03/13 22:22:32 ----------------------------------------------------------------------------------- | |
2021/03/13 22:22:32 Running '2.3 MySQL DB Check', 1..16 tests | |
2021/03/13 22:22:32 ----------------------------------------------------------------------------------- | |
2021/03/13 22:22:39 ✓ [2.3 MySQL DB Check] => 'mysql_db_check' role linter (1), 5.264s | |
2021/03/13 22:22:41 ✓ [2.3 MySQL DB Check] => 'role-mysqldb-check.yml' playbook syntax check (1), 1.73s | |
2021/03/13 22:24:36 ✓ [2.3 MySQL DB Check] => apply 'role-mysqldb-check.yml' playbook (1), 1m55.085s | |
2021/03/13 22:26:17 ✓ [2.3 MySQL DB Check] => apply 'mysql_db_check' role (default settings) (1), 1m41.492s | |
2021/03/13 22:26:17 ✓ [2.3 MySQL DB Check] => service responds 200 (after initial rollout) (1), 191ms | |
2021/03/13 22:27:10 ✗ [2.3 MySQL DB Check] -> idempotency check (apply the role twice) | |
2021/03/13 22:27:10 Result: exit status 1 | |
2021/03/13 22:27:10 Output: | |
(run, /tmp/students-2/anton_antanovich/day2/2.3) => ansible-playbook testing-role-mysqldb-check.yml -i db-check, -v | |
rc: 0 | |
output: | | |
[0;34mUsing /tmp/students-2/anton_antanovich/day2/2.3/ansible.cfg as config file | |
PLAY [db-check] **************************************************************** | |
TASK [base : Check facts directory] ******************************************** | |
[0;32mok: [db-check] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/etc/ansible/facts.d", "size": 4096, "state": "directory", "uid": 0} | |
TASK [base : Gathering facts] ************************************************** | |
[0;32mok: [db-check] | |
TASK [base : epel-release installer] ******************************************* | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "changes": {"installed": [], "updated": []}, "msg": "", "rc": 0, "results": ["All packages providing epel-release are up to date", "All packages providing curl are up to date", "All packages providing wget are up to date", "All packages providing sudo are up to date", "All packages providing iproute are up to date", ""]} | |
TASK [base : python] *********************************************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "msg": "", "rc": 0, "results": ["python3-3.6.8-18.el7.x86_64 providing python3 is already installed", "python3-pip-9.0.3-8.el7.noarch providing python3-pip is already installed", "python-devel-2.7.5-90.el7.x86_64 providing python-devel is already installed"]} | |
TASK [base : latest pip] ******************************************************* | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "cmd": ["pip", "install", "--upgrade", "pip"], "delta": "0:00:01.133893", "end": "2021-03-13 22:26:30.021533", "rc": 0, "start": "2021-03-13 22:26:28.887640", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)", "stdout_lines": ["Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)"]} | |
TASK [base : Install pymysql] ************************************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "cmd": ["/bin/pip2", "install", "pymysql"], "name": ["pymysql"], "requirements": null, "state": "present", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.\n", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)\n", "stdout_lines": ["Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)"], "version": null, "virtualenv": null} | |
TASK [user : Create group mysqldb-check] *************************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "gid": 1014, "name": "mysqldb-check", "state": "present", "system": false} | |
TASK [user : Create user mysqldb-check] **************************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "append": false, "changed": false, "comment": "", "group": 1014, "home": "/opt/mysqldb-check", "move_home": false, "name": "mysqldb-check", "shell": "/bin/sh", "state": "present", "uid": 1014} | |
TASK [user : Give sudo privileges] ********************************************* | |
[0;36mskipping: [db-check] => {"changed": false, "skip_reason": "Conditional result was False"} | |
TASK [mysql_db_check : Make binary folder] ************************************* | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "gid": 1014, "group": "mysqldb-check", "mode": "0755", "owner": "mysqldb-check", "path": "/opt/mysqldb-check/bin", "size": 4096, "state": "directory", "uid": 1014} | |
TASK [mysql_db_check : Make config folder] ************************************* | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "gid": 1014, "group": "mysqldb-check", "mode": "0755", "owner": "mysqldb-check", "path": "/opt/mysqldb-check/conf", "size": 4096, "state": "directory", "uid": 1014} | |
TASK [mysql_db_check : Download bin file and set permissions] ****************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "checksum_dest": null, "checksum_src": null, "dest": "/opt/mysqldb-check/bin/mysql-check", "elapsed": 0, "gid": 1014, "group": "mysqldb-check", "mode": "0750", "msg": "file already exists", "owner": "mysqldb-check", "size": 1818876, "state": "file", "uid": 1014, "url": "https://playpit-labs-assets.s3-eu-west-1.amazonaws.com/mysql-check/mysql-check"} | |
TASK [mysql_db_check : Copy configuration files] ******************************* | |
[0;32mok: [db-check] => {"changed": false, "checksum": "ddac175155cd33f99921b6ba7d2757bc5e788f30", "dest": "/opt/mysqldb-check/conf/mysql_check.conf", "gid": 1014, "group": "mysqldb-check", "mode": "0644", "owner": "mysqldb-check", "path": "/opt/mysqldb-check/conf/mysql_check.conf", "size": 10, "state": "file", "uid": 1014} | |
TASK [mysql_db_check : Copy UNIT] ********************************************** | |
[0;32mok: [db-check] => {"changed": false, "checksum": "c1c9133bac378237ba88d67c8e3a2caddc091150", "dest": "/etc/systemd/system/mysql_check.service", "gid": 1014, "group": "mysqldb-check", "mode": "0644", "owner": "mysqldb-check", "path": "/etc/systemd/system/mysql_check.service", "size": 295, "state": "file", "uid": 1014} | |
TASK [mysql_db_check : Check servicr] ****************************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "enabled": true, "name": "mysql_check", "state": "started", "status": {"ActiveEnterTimestamp": "Sat 2021-03-13 22:25:46 UTC", "ActiveEnterTimestampMonotonic": "352239449473", "ActiveExitTimestampMonotonic": "0", "ActiveState": "active", "After": "systemd-journald.socket system.slice network.target basic.target", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "yes", "AssertTimestamp": "Sat 2021-03-13 22:25:46 UTC", "AssertTimestampMonotonic": "352239447962", "Before": "multi-user.target shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "ConditionResult": "yes", "ConditionTimestamp": "Sat 2021-03-13 22:25:46 UTC", "ConditionTimestampMonotonic": "352239447955", "Conflicts": "shutdown.target", "ControlGroup": "/docker/a7f6985fae7f9a3124adb1749a25828c4af02c480b140d0813e63a0855ceca02/system.slice/mysql_check.service", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "MySQL checker", "DevicePolicy": "auto", "EnvironmentFile": "/opt/mysqldb-check/conf/mysql_check.conf (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "2519", "ExecMainStartTimestamp": "Sat 2021-03-13 22:25:46 UTC", "ExecMainStartTimestampMonotonic": "352239449350", "ExecMainStatus": "0", "ExecStart": "{ path=/opt/mysqldb-check/bin/mysql-check ; argv[]=/opt/mysqldb-check/bin/mysql-check ; ignore_errors=no ; start_time=[Sat 2021-03-13 22:25:46 UTC] ; stop_time=[n/a] ; pid=2519 ; code=(null) ; status=0/0 }", "ExecStop": "{ path=/bin/kill ; argv[]=/bin/kill -s QUIT $MAINPID ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/etc/systemd/system/mysql_check.service", "Group": "mysqldb-check", "GuessMainPID": "yes", "IOScheduling": "4", "Id": "mysql_check.service", "IgnoreOnIsolate": "no", "IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestamp": "Sat 2021-03-13 22:25:46 UTC", "InactiveExitTimestampMonotonic": "352239449473", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "67108864", "LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "1048576", "LimitNPROC": "18446744073709551615", "LimitRSS": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "29790", "LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": "2519", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": "mysql_check.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "Requires": "basic.target", "Restart": "no", "RestartUSec": "100ms", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitInterval": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "running", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": "18446744073709551615", "TasksMax": "18446744073709551615", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "simple", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "enabled", "User": "mysqldb-check", "WantedBy": "multi-user.target", "Wants": "system.slice", "WatchdogTimestamp": "Sat 2021-03-13 22:25:46 UTC", "WatchdogTimestampMonotonic": "352239449432", "WatchdogUSec": "0"}} | |
TASK [mysql_db_check : Wait 30 sec and check port db] ************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "elapsed": 30, "match_groupdict": {}, "match_groups": [], "path": null, "port": 8080, "search_regex": null, "state": "started"} | |
PLAY RECAP ********************************************************************* | |
[0;33mdb-check : [0;32mok=15 [0;33mchanged=1 unreachable=0 failed=0 [0;36mskipped=1 rescued=0 ignored=0 | |
Stdout Assertion Failed (Partial, 'changed=0') | |
2021/03/13 22:27:11 ✓ [2.3 MySQL DB Check] => service responds 200 (after idempotancy check) (1), 305ms | |
2021/03/13 22:27:11 ✗ [2.3 MySQL DB Check] -> service is enabled | |
2021/03/13 22:27:11 Result: exit status 1 | |
2021/03/13 22:27:11 Output: | |
Failed to get unit file state for mysqldb-check.service: No such file or directory | |
2021/03/13 22:27:11 ✗ [2.3 MySQL DB Check] -> service runs under proper user/group | |
2021/03/13 22:27:11 Result: exit status 1 | |
2021/03/13 22:27:11 Output: | |
2021/03/13 22:27:11 ✓ [2.3 MySQL DB Check] => application user has no password set (1), 216ms | |
2021/03/13 22:28:48 ✓ [2.3 MySQL DB Check] => trying another application port (1), 1m36.746s | |
2021/03/13 22:30:22 ✓ [2.3 MySQL DB Check] => trying another application home dir (1), 1m34.487s | |
2021/03/13 22:32:17 ✗ [2.3 MySQL DB Check] -> trying another application user | |
2021/03/13 22:32:17 Result: exit status 1 | |
2021/03/13 22:32:17 Output: | |
db-check | |
56684328d5e6b6228fabd816919e80a08a87ed7975beb4add3eb8243e67969aa | |
[0;34mUsing /tmp/students-2/anton_antanovich/day2/2.3/ansible.cfg as config file | |
PLAY [db-check] **************************************************************** | |
TASK [base : Check facts directory] ******************************************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": true, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/etc/ansible/facts.d", "size": 4096, "state": "directory", "uid": 0} | |
TASK [base : Gathering facts] ************************************************** | |
[0;32mok: [db-check] | |
TASK [base : epel-release installer] ******************************************* | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "changes": {"installed": ["wget"], "updated": [["iproute", "4.11.0-30.el7.x86_64 from base"], ["curl", "7.29.0-59.el7_9.1.x86_64 from updates"], ["sudo", "1.8.23-10.el7_9.1.x86_64 from updates"], ["epel-release", "7-13.noarch from epel"]]}, "msg": "", "rc": 0, "results": ["Loaded plugins: fastestmirror, ovl\nLoading mirror speeds from cached hostfile\n * base: mirror.datacenter.by\n * epel: mirror.datacenter.by\n * extras: mirror.datacenter.by\n * updates: mirror.datacenter.by\nResolving Dependencies\n--> Running transaction check\n---> Package curl.x86_64 0:7.29.0-51.el7 will be updated\n---> Package curl.x86_64 0:7.29.0-59.el7_9.1 will be an update\n--> Processing Dependency: libcurl = 7.29.0-59.el7_9.1 for package: curl-7.29.0-59.el7_9.1.x86_64\n---> Package epel-release.noarch 0:7-11 will be updated\n---> Package epel-release.noarch 0:7-13 will be an update\n---> Package iproute.x86_64 0:4.11.0-14.el7 will be updated\n---> Package iproute.x86_64 0:4.11.0-30.el7 will be an update\n---> Package sudo.x86_64 0:1.8.23-3.el7 will be updated\n---> Package sudo.x86_64 0:1.8.23-10.el7_9.1 will be an update\n---> Package wget.x86_64 0:1.14-18.el7_6.1 will be installed\n--> Running transaction check\n---> Package libcurl.x86_64 0:7.29.0-51.el7 will be updated\n---> Package libcurl.x86_64 0:7.29.0-59.el7_9.1 will be an update\n--> Processing Dependency: libssh2(x86-64) >= 1.8.0 for package: libcurl-7.29.0-59.el7_9.1.x86_64\n--> Running transaction check\n---> Package libssh2.x86_64 0:1.4.3-12.el7_6.2 will be updated\n---> Package libssh2.x86_64 0:1.8.0-4.el7 will be an update\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n wget x86_64 1.14-18.el7_6.1 base 547 k\nUpdating:\n curl x86_64 7.29.0-59.el7_9.1 updates 271 k\n epel-release noarch 7-13 epel 15 k\n iproute x86_64 4.11.0-30.el7 base 805 k\n sudo x86_64 1.8.23-10.el7_9.1 updates 843 k\nUpdating for dependencies:\n libcurl x86_64 7.29.0-59.el7_9.1 updates 223 k\n libssh2 x86_64 1.8.0-4.el7 base 88 k\n\nTransaction Summary\n================================================================================\nInstall 1 Package\nUpgrade 4 Packages (+2 Dependent packages)\n\nTotal download size: 2.7 M\nDownloading packages:\nNo Presto metadata available for base\nNo Presto metadata available for updates\n--------------------------------------------------------------------------------\nTotal 6.2 MB/s | 2.7 MB 00:00 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Updating : libssh2-1.8.0-4.el7.x86_64 1/13 \n Updating : libcurl-7.29.0-59.el7_9.1.x86_64 2/13 \n Updating : curl-7.29.0-59.el7_9.1.x86_64 3/13 \n Updating : epel-release-7-13.noarch 4/13 \n Updating : sudo-1.8.23-10.el7_9.1.x86_64 5/13 \n Updating : iproute-4.11.0-30.el7.x86_64 6/13 \n Installing : wget-1.14-18.el7_6.1.x86_64 7/13 \ninstall-info: No such file or directory for /usr/share/info/wget.info.gz\n Cleanup : curl-7.29.0-51.el7.x86_64 8/13 \n Cleanup : epel-release-7-11.noarch 9/13 \n Cleanup : libcurl-7.29.0-51.el7.x86_64 10/13 \n Cleanup : libssh2-1.4.3-12.el7_6.2.x86_64 11/13 \n Cleanup : sudo-1.8.23-3.el7.x86_64 12/13 \n Cleanup : iproute-4.11.0-14.el7.x86_64 13/13 \n Verifying : curl-7.29.0-59.el7_9.1.x86_64 1/13 \n Verifying : libssh2-1.8.0-4.el7.x86_64 2/13 \n Verifying : wget-1.14-18.el7_6.1.x86_64 3/13 \n Verifying : iproute-4.11.0-30.el7.x86_64 4/13 \n Verifying : sudo-1.8.23-10.el7_9.1.x86_64 5/13 \n Verifying : libcurl-7.29.0-59.el7_9.1.x86_64 6/13 \n Verifying : epel-release-7-13.noarch 7/13 \n Verifying : sudo-1.8.23-3.el7.x86_64 8/13 \n Verifying : epel-release-7-11.noarch 9/13 \n Verifying : libssh2-1.4.3-12.el7_6.2.x86_64 10/13 \n Verifying : curl-7.29.0-51.el7.x86_64 11/13 \n Verifying : iproute-4.11.0-14.el7.x86_64 12/13 \n Verifying : libcurl-7.29.0-51.el7.x86_64 13/13 \n\nInstalled:\n wget.x86_64 0:1.14-18.el7_6.1 \n\nUpdated:\n curl.x86_64 0:7.29.0-59.el7_9.1 epel-release.noarch 0:7-13 \n iproute.x86_64 0:4.11.0-30.el7 sudo.x86_64 0:1.8.23-10.el7_9.1 \n\nDependency Updated:\n libcurl.x86_64 0:7.29.0-59.el7_9.1 libssh2.x86_64 0:1.8.0-4.el7 \n\nComplete!\n"]} | |
TASK [base : python] *********************************************************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "changes": {"installed": ["python3", "python3-pip", "python-devel"]}, "msg": "", "rc": 0, "results": ["Loaded plugins: fastestmirror, ovl\nLoading mirror speeds from cached hostfile\n * base: mirror.datacenter.by\n * epel: mirror.datacenter.by\n * extras: mirror.datacenter.by\n * updates: mirror.datacenter.by\nResolving Dependencies\n--> Running transaction check\n---> Package python-devel.x86_64 0:2.7.5-90.el7 will be installed\n--> Processing Dependency: python(x86-64) = 2.7.5-90.el7 for package: python-devel-2.7.5-90.el7.x86_64\n--> Processing Dependency: python2-rpm-macros > 3-30 for package: python-devel-2.7.5-90.el7.x86_64\n--> Processing Dependency: python-rpm-macros > 3-30 for package: python-devel-2.7.5-90.el7.x86_64\n---> Package python3.x86_64 0:3.6.8-18.el7 will be installed\n--> Processing Dependency: python3-libs(x86-64) = 3.6.8-18.el7 for package: python3-3.6.8-18.el7.x86_64\n--> Processing Dependency: python3-setuptools for package: python3-3.6.8-18.el7.x86_64\n--> Processing Dependency: libpython3.6m.so.1.0()(64bit) for package: python3-3.6.8-18.el7.x86_64\n---> Package python3-pip.noarch 0:9.0.3-8.el7 will be installed\n--> Running transaction check\n---> Package python.x86_64 0:2.7.5-77.el7_6 will be updated\n---> Package python.x86_64 0:2.7.5-90.el7 will be an update\n--> Processing Dependency: python-libs(x86-64) = 2.7.5-90.el7 for package: python-2.7.5-90.el7.x86_64\n---> Package python-rpm-macros.noarch 0:3-34.el7 will be installed\n--> Processing Dependency: python-srpm-macros for package: python-rpm-macros-3-34.el7.noarch\n---> Package python2-rpm-macros.noarch 0:3-34.el7 will be installed\n---> Package python3-libs.x86_64 0:3.6.8-18.el7 will be installed\n--> Processing Dependency: libtirpc.so.1()(64bit) for package: python3-libs-3.6.8-18.el7.x86_64\n---> Package python3-setuptools.noarch 0:39.2.0-10.el7 will be installed\n--> Running transaction check\n---> Package libtirpc.x86_64 0:0.2.4-0.16.el7 will be installed\n---> Package python-libs.x86_64 0:2.7.5-77.el7_6 will be updated\n---> Package python-libs.x86_64 0:2.7.5-90.el7 will be an update\n---> Package python-srpm-macros.noarch 0:3-34.el7 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n python-devel x86_64 2.7.5-90.el7 updates 399 k\n python3 x86_64 3.6.8-18.el7 updates 70 k\n python3-pip noarch 9.0.3-8.el7 base 1.6 M\nInstalling for dependencies:\n libtirpc x86_64 0.2.4-0.16.el7 base 89 k\n python-rpm-macros noarch 3-34.el7 base 9.1 k\n python-srpm-macros noarch 3-34.el7 base 8.8 k\n python2-rpm-macros noarch 3-34.el7 base 8.1 k\n python3-libs x86_64 3.6.8-18.el7 updates 6.9 M\n python3-setuptools noarch 39.2.0-10.el7 base 629 k\nUpdating for dependencies:\n python x86_64 2.7.5-90.el7 updates 96 k\n python-libs x86_64 2.7.5-90.el7 updates 5.6 M\n\nTransaction Summary\n================================================================================\nInstall 3 Packages (+6 Dependent packages)\nUpgrade ( 2 Dependent packages)\n\nTotal download size: 15 M\nDownloading packages:\nNo Presto metadata available for updates\n--------------------------------------------------------------------------------\nTotal 36 MB/s | 15 MB 00:00 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Updating : python-libs-2.7.5-90.el7.x86_64 1/13 \n Updating : python-2.7.5-90.el7.x86_64 2/13 \n Installing : python-srpm-macros-3-34.el7.noarch 3/13 \n Installing : python-rpm-macros-3-34.el7.noarch 4/13 \n Installing : python2-rpm-macros-3-34.el7.noarch 5/13 \n Installing : libtirpc-0.2.4-0.16.el7.x86_64 6/13 \n Installing : python3-setuptools-39.2.0-10.el7.noarch 7/13 \n Installing : python3-pip-9.0.3-8.el7.noarch 8/13 \n Installing : python3-3.6.8-18.el7.x86_64 9/13 \n Installing : python3-libs-3.6.8-18.el7.x86_64 10/13 \n Installing : python-devel-2.7.5-90.el7.x86_64 11/13 \n Cleanup : python-2.7.5-77.el7_6.x86_64 12/13 \n Cleanup : python-libs-2.7.5-77.el7_6.x86_64 13/13 \n Verifying : libtirpc-0.2.4-0.16.el7.x86_64 1/13 \n Verifying : python2-rpm-macros-3-34.el7.noarch 2/13 \n Verifying : python3-libs-3.6.8-18.el7.x86_64 3/13 \n Verifying : python-devel-2.7.5-90.el7.x86_64 4/13 \n Verifying : python-2.7.5-90.el7.x86_64 5/13 \n Verifying : python3-setuptools-39.2.0-10.el7.noarch 6/13 \n Verifying : python-srpm-macros-3-34.el7.noarch 7/13 \n Verifying : python-rpm-macros-3-34.el7.noarch 8/13 \n Verifying : python3-3.6.8-18.el7.x86_64 9/13 \n Verifying : python3-pip-9.0.3-8.el7.noarch 10/13 \n Verifying : python-libs-2.7.5-90.el7.x86_64 11/13 \n Verifying : python-2.7.5-77.el7_6.x86_64 12/13 \n Verifying : python-libs-2.7.5-77.el7_6.x86_64 13/13 \n\nInstalled:\n python-devel.x86_64 0:2.7.5-90.el7 python3.x86_64 0:3.6.8-18.el7 \n python3-pip.noarch 0:9.0.3-8.el7 \n\nDependency Installed:\n libtirpc.x86_64 0:0.2.4-0.16.el7 \n python-rpm-macros.noarch 0:3-34.el7 \n python-srpm-macros.noarch 0:3-34.el7 \n python2-rpm-macros.noarch 0:3-34.el7 \n python3-libs.x86_64 0:3.6.8-18.el7 \n python3-setuptools.noarch 0:39.2.0-10.el7 \n\nDependency Updated:\n python.x86_64 0:2.7.5-90.el7 python-libs.x86_64 0:2.7.5-90.el7 \n\nComplete!\n"]} | |
TASK [base : latest pip] ******************************************************* | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "cmd": ["pip", "install", "--upgrade", "pip"], "delta": "0:00:10.035611", "end": "2021-03-13 22:31:31.356838", "rc": 0, "start": "2021-03-13 22:31:21.321227", "stderr": "DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.", "stderr_lines": ["DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7."], "stdout": "Collecting pip\n Downloading https://files.pythonhosted.org/packages/27/79/8a850fe3496446ff0d584327ae44e7500daf6764ca1a382d2d02789accf7/pip-20.3.4-py2.py3-none-any.whl (1.5MB)\nInstalling collected packages: pip\n Found existing installation: pip 19.1\n Uninstalling pip-19.1:\n Successfully uninstalled pip-19.1\nSuccessfully installed pip-20.3.4", "stdout_lines": ["Collecting pip", " Downloading https://files.pythonhosted.org/packages/27/79/8a850fe3496446ff0d584327ae44e7500daf6764ca1a382d2d02789accf7/pip-20.3.4-py2.py3-none-any.whl (1.5MB)", "Installing collected packages: pip", " Found existing installation: pip 19.1", " Uninstalling pip-19.1:", " Successfully uninstalled pip-19.1", "Successfully installed pip-20.3.4"]} | |
TASK [base : Install pymysql] ************************************************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "cmd": ["/bin/pip2", "install", "pymysql"], "name": ["pymysql"], "requirements": null, "state": "present", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.\n", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Collecting pymysql\n Downloading PyMySQL-0.10.1-py2.py3-none-any.whl (47 kB)\nInstalling collected packages: pymysql\nSuccessfully installed pymysql-0.10.1\n", "stdout_lines": ["Collecting pymysql", " Downloading PyMySQL-0.10.1-py2.py3-none-any.whl (47 kB)", "Installing collected packages: pymysql", "Successfully installed pymysql-0.10.1"], "version": null, "virtualenv": null} | |
TASK [user : Create group mysqldb-check-test] ********************************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "gid": 1014, "name": "mysqldb-check-test", "state": "present", "system": false} | |
TASK [user : Create user mysqldb-check-test] *********************************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "comment": "", "create_home": true, "group": 1014, "home": "/opt/mysqldb-check", "name": "mysqldb-check-test", "shell": "/bin/sh", "state": "present", "system": false, "uid": 1014} | |
TASK [user : Give sudo privileges] ********************************************* | |
[0;36mskipping: [db-check] => {"changed": false, "skip_reason": "Conditional result was False"} | |
TASK [mysql_db_check : Make binary folder] ************************************* | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "gid": 1014, "group": "mysqldb-check-test", "mode": "0755", "owner": "mysqldb-check-test", "path": "/opt/mysqldb-check/bin", "size": 4096, "state": "directory", "uid": 1014} | |
TASK [mysql_db_check : Make config folder] ************************************* | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "gid": 1014, "group": "mysqldb-check-test", "mode": "0755", "owner": "mysqldb-check-test", "path": "/opt/mysqldb-check/conf", "size": 4096, "state": "directory", "uid": 1014} | |
TASK [mysql_db_check : Download bin file and set permissions] ****************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "checksum_dest": null, "checksum_src": "aa78532d520cf2f82ccc587af851596c0d17d08c", "dest": "/opt/mysqldb-check/bin/mysql-check", "elapsed": 0, "gid": 1014, "group": "mysqldb-check-test", "md5sum": "0b5a84cf51fcf79480b4f36b4c88153b", "mode": "0750", "msg": "OK (1818876 bytes)", "owner": "mysqldb-check-test", "size": 1818876, "src": "/root/.ansible/tmp/ansible-moduletmp-1615674699.7-DxdMLG/tmpN9rZUh", "state": "file", "status_code": 200, "uid": 1014, "url": "https://playpit-labs-assets.s3-eu-west-1.amazonaws.com/mysql-check/mysql-check"} | |
TASK [mysql_db_check : Copy configuration files] ******************************* | |
[0;33mchanged: [db-check] => {"changed": true, "checksum": "ddac175155cd33f99921b6ba7d2757bc5e788f30", "dest": "/opt/mysqldb-check/conf/mysql_check.conf", "gid": 1014, "group": "mysqldb-check-test", "md5sum": "62ce1f99ceea71082d2ee6e95318fba3", "mode": "0644", "owner": "mysqldb-check-test", "size": 10, "src": "/root/.ansible/tmp/ansible_mitogen_action_c95888c7dd181737/source", "state": "file", "uid": 1014} | |
TASK [mysql_db_check : Copy UNIT] ********************************************** | |
[0;33mchanged: [db-check] => {"changed": true, "checksum": "58e3de2834613ce9a5127fc2b7b83d9f16b0e5cd", "dest": "/etc/systemd/system/mysql_check.service", "gid": 1014, "group": "mysqldb-check-test", "md5sum": "8ccb6a6781b6ae47ba102d40a6599e72", "mode": "0644", "owner": "mysqldb-check-test", "size": 305, "src": "/root/.ansible/tmp/ansible_mitogen_action_b9713b8e9a32eb88/source", "state": "file", "uid": 1014} | |
TASK [mysql_db_check : Check servicr] ****************************************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "enabled": true, "name": "mysql_check", "state": "started", "status": {"ActiveEnterTimestampMonotonic": "0", "ActiveExitTimestampMonotonic": "0", "ActiveState": "inactive", "After": "basic.target network.target systemd-journald.socket system.slice", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "no", "AssertTimestampMonotonic": "0", "Before": "shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "ConditionResult": "no", "ConditionTimestampMonotonic": "0", "Conflicts": "shutdown.target", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "MySQL checker", "DevicePolicy": "auto", "EnvironmentFile": "/opt/mysqldb-check/conf/mysql_check.conf (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "0", "ExecMainStartTimestampMonotonic": "0", "ExecMainStatus": "0", "ExecStart": "{ path=/opt/mysqldb-check/bin/mysql-check ; argv[]=/opt/mysqldb-check/bin/mysql-check ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "ExecStop": "{ path=/bin/kill ; argv[]=/bin/kill -s QUIT $MAINPID ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/etc/systemd/system/mysql_check.service", "Group": "mysqldb-check-test", "GuessMainPID": "yes", "IOScheduling": "4", "Id": "mysql_check.service", "IgnoreOnIsolate": "no", "IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestampMonotonic": "0", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "67108864", "LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "1048576", "LimitNPROC": "18446744073709551615", "LimitRSS": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "29790", "LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": "0", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": "mysql_check.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "Requires": "basic.target", "Restart": "no", "RestartUSec": "100ms", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitInterval": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "dead", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": "18446744073709551615", "TasksMax": "18446744073709551615", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "simple", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "disabled", "User": "mysqldb-check-test", "Wants": "system.slice", "WatchdogTimestampMonotonic": "0", "WatchdogUSec": "0"}} | |
TASK [mysql_db_check : Wait 30 sec and check port db] ************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "elapsed": 30, "match_groupdict": {}, "match_groups": [], "path": null, "port": 8080, "search_regex": null, "state": "started"} | |
PLAY RECAP ********************************************************************* | |
[0;33mdb-check : [0;32mok=15 [0;33mchanged=13 unreachable=0 failed=0 [0;36mskipped=1 rescued=0 ignored=0 | |
* About to connect() to localhost port 8080 (#0) | |
* Trying 127.0.0.1... | |
* Connected to localhost (127.0.0.1) port 8080 (#0) | |
> GET / HTTP/1.1 | |
> User-Agent: curl/7.29.0 | |
> Host: localhost:8080 | |
> Accept: */* | |
> | |
< HTTP/1.1 200 OK | |
< Date: Sat, 13 Mar 2021 22:32:16 GMT | |
< Content-Type: text/html; charset=utf-8 | |
< Transfer-Encoding: chunked | |
< | |
{ [data not shown] | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Testing DB Connectivity</title> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:300" > | |
<link rel="stylesheet" href="https://kit-free.fontawesome.com/releases/latest/css/free.min.css" media="all"> | |
<link rel="stylesheet" href="https://bootswatch.com/_vendor/bootstrap/dist/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://bootswatch.com/_vendor/bootstrap/dist/css/bootstrap.css"> | |
<link rel="stylesheet" href="https://kit-free.fontawesome.com/releases/latest/css/free.min.css" media="all"> | |
<script type="text/javascript" src="//code.jquery.com/jquery-latest.min.js"></script> | |
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> | |
<style> | |
body { | |
margin:0; | |
padding:0; | |
background-color:#303030; | |
} | |
div.main { | |
text-align: center; | |
} | |
div.main img { | |
margin: 40px 0; | |
} | |
div.content { | |
color: #f2f2f2; | |
position: absolute; | |
margin: auto; | |
width: 500px; | |
left: 50%; | |
margin-left: -250px; | |
top: 188px; | |
/* margin-top: -250px; */ | |
} | |
.content #message { | |
margin: 10px 0 50px 0; | |
padding: 30px 0; | |
font-family: 'Ubuntu', sans-serif; | |
font-weight: 300; | |
font-size: 32pt; | |
background-color: #505050; | |
border-top: 2px solid #909090; | |
border-bottom: 2px solid #909090; | |
} | |
.author { | |
text-align: right; | |
font-family: 'Ubuntu', sans-serif; | |
font-weight: 300; | |
font-size: 12pt; | |
} | |
.content #info { | |
margin: 0 auto; | |
font-family: 'Ubuntu', sans-serif; | |
font-weight: 300; | |
font-size: 12pt; | |
} | |
.content #info table { | |
margin: 10px auto; | |
} | |
.content #info table th { | |
text-align: right; | |
padding-right: 20px; | |
} | |
.content #info table td { | |
text-align: left; | |
} | |
fa, .far, .fas { | |
font-family: "Font Awesome 5 Pro"; | |
font-size: -webkit-xxx-large; | |
} | |
</style> | |
<script type="text/javascript"> | |
function checkBtnClick() { | |
$.post('/check', { | |
dbhostname: $("#dbhost_value").val(), | |
dbport: $("#dbport_value").val(), | |
dbname: $("#dbname_value").val(), | |
dbuser: $("#dbuser_value").val(), | |
dbuserpassword: $("#dbuserpassword_value").val() | |
}).done(function(data) { | |
$('#check-content').html("<i class='far fa-thumbs-up'></i><b style='font-family: Ubuntu,sans-serif; font-weight: 300;font-size: 28pt;'> Connected!</b>"); | |
$('#check-content').css('display', 'block'); | |
}).fail(function(data) { | |
console.log(data); | |
$('#check-content').css('display', 'block'); | |
$('#check-content').html("<i class='fas fa-exclamation-triangle'></i><b style='font-family: Ubuntu,sans-serif; font-weight: 300;font-size: 28pt;'> Failed!</b>"); | |
$('#check-content-error').html(data.responseText); | |
$('#check-content-error').css('display', 'block'); | |
}); | |
} | |
</script> | |
</head> | |
<body> | |
<div class="main"> | |
<!--form id="db_datta"--> | |
<img width="300" style="margin-top: -20px;" src="https://database-programmers.com/img/icons/icon-mysql.png" /> | |
<div class="content" name="check-content"> | |
<div style="font-size: 8pt; font-family: "Ubuntu""> | |
Developed by Siarhei Beliakou for <a href="https://github.com/sbeliakou/playpit-labs" target="_blank">playpit-labs</a> | |
</div> | |
<div class="input-group input-group-sm mb-3"> | |
<div class="input-group-prepend"> | |
<span class="input-group-text" id="dbhostname" style="width: 150px;">DB Hostname</span> | |
</div> | |
<input id="dbhost_value" type="text" class="form-control" aria-label="Sizing example input" aria-describedby="dbhostname"> | |
<div class="input-group-prepend"> | |
* Connection #0 to host localhost left intact | |
<span class="input-group-text" id="dbport">DB Port</span> | |
</div> | |
<input id="dbport_value" type="text" class="form-control" placeholder="3306" aria-label="Sizing example input" aria-describedby="dbport"> | |
</div> | |
<div class="input-group input-group-sm mb-3"> | |
<div class="input-group-prepend"> | |
<span class="input-group-text" id="dbname" style="width: 150px;">Data Base Name</span> | |
</div> | |
<input id="dbname_value" type="text" class="form-control" aria-label="Sizing example input" aria-describedby="dbname"> | |
</div> | |
<div class="input-group input-group-sm mb-3"> | |
<div class="input-group-prepend"> | |
<span class="input-group-text" id="dbuser" style="width: 150px;">DB User Name</span> | |
</div> | |
<input id="dbuser_value" type="text" class="form-control" aria-label="Sizing example input" aria-describedby="dbuser"> | |
</div> | |
<div class="input-group input-group-sm mb-3"> | |
<div class="input-group-prepend"> | |
<span class="input-group-text" id="dbuserpassword" style="width: 150px;">DB Password</span> | |
</div> | |
<input id="dbuserpassword_value" type="text" class="form-control" aria-label="Sizing example input" aria-describedby="dbuserpassword"> | |
</div> | |
<button name='checkMeBtn' class="btn btn-outline-light btn-rounded btn-block my-4 waves-effect z-depth-0" onclick="checkBtnClick();">Check Connection</button> | |
<div id='check-content' style='display: none;'>Placeholder</div> | |
<div id='check-content-error' style='display: none;'>Placeholder</div> | |
</div> | |
<!--/form--> | |
</div> | |
</body> | |
</html> | |
2021/03/13 22:34:30 ✗ [2.3 MySQL DB Check] -> trying another application group | |
2021/03/13 22:34:30 Result: exit status 1 | |
2021/03/13 22:34:30 Output: | |
db-check | |
750818f8434bbba6342c95733064aadc7c1dd99226cfaac7a9738ded090ce2e9 | |
[0;34mUsing /tmp/students-2/anton_antanovich/day2/2.3/ansible.cfg as config file | |
PLAY [db-check] **************************************************************** | |
TASK [base : Check facts directory] ******************************************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": true, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/etc/ansible/facts.d", "size": 4096, "state": "directory", "uid": 0} | |
TASK [base : Gathering facts] ************************************************** | |
[0;32mok: [db-check] | |
TASK [base : epel-release installer] ******************************************* | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "changes": {"installed": ["wget"], "updated": [["iproute", "4.11.0-30.el7.x86_64 from base"], ["curl", "7.29.0-59.el7_9.1.x86_64 from updates"], ["sudo", "1.8.23-10.el7_9.1.x86_64 from updates"], ["epel-release", "7-13.noarch from epel"]]}, "msg": "", "rc": 0, "results": ["Loaded plugins: fastestmirror, ovl\nLoading mirror speeds from cached hostfile\n * base: ftp.byfly.by\n * epel: mirror.datacenter.by\n * extras: ftp.byfly.by\n * updates: ftp.byfly.by\nResolving Dependencies\n--> Running transaction check\n---> Package curl.x86_64 0:7.29.0-51.el7 will be updated\n---> Package curl.x86_64 0:7.29.0-59.el7_9.1 will be an update\n--> Processing Dependency: libcurl = 7.29.0-59.el7_9.1 for package: curl-7.29.0-59.el7_9.1.x86_64\n---> Package epel-release.noarch 0:7-11 will be updated\n---> Package epel-release.noarch 0:7-13 will be an update\n---> Package iproute.x86_64 0:4.11.0-14.el7 will be updated\n---> Package iproute.x86_64 0:4.11.0-30.el7 will be an update\n---> Package sudo.x86_64 0:1.8.23-3.el7 will be updated\n---> Package sudo.x86_64 0:1.8.23-10.el7_9.1 will be an update\n---> Package wget.x86_64 0:1.14-18.el7_6.1 will be installed\n--> Running transaction check\n---> Package libcurl.x86_64 0:7.29.0-51.el7 will be updated\n---> Package libcurl.x86_64 0:7.29.0-59.el7_9.1 will be an update\n--> Processing Dependency: libssh2(x86-64) >= 1.8.0 for package: libcurl-7.29.0-59.el7_9.1.x86_64\n--> Running transaction check\n---> Package libssh2.x86_64 0:1.4.3-12.el7_6.2 will be updated\n---> Package libssh2.x86_64 0:1.8.0-4.el7 will be an update\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n wget x86_64 1.14-18.el7_6.1 base 547 k\nUpdating:\n curl x86_64 7.29.0-59.el7_9.1 updates 271 k\n epel-release noarch 7-13 epel 15 k\n iproute x86_64 4.11.0-30.el7 base 805 k\n sudo x86_64 1.8.23-10.el7_9.1 updates 843 k\nUpdating for dependencies:\n libcurl x86_64 7.29.0-59.el7_9.1 updates 223 k\n libssh2 x86_64 1.8.0-4.el7 base 88 k\n\nTransaction Summary\n================================================================================\nInstall 1 Package\nUpgrade 4 Packages (+2 Dependent packages)\n\nTotal download size: 2.7 M\nDownloading packages:\nNo Presto metadata available for base\nNo Presto metadata available for updates\n--------------------------------------------------------------------------------\nTotal 4.8 MB/s | 2.7 MB 00:00 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Updating : libssh2-1.8.0-4.el7.x86_64 1/13 \n Updating : libcurl-7.29.0-59.el7_9.1.x86_64 2/13 \n Updating : curl-7.29.0-59.el7_9.1.x86_64 3/13 \n Updating : epel-release-7-13.noarch 4/13 \n Updating : sudo-1.8.23-10.el7_9.1.x86_64 5/13 \n Updating : iproute-4.11.0-30.el7.x86_64 6/13 \n Installing : wget-1.14-18.el7_6.1.x86_64 7/13 \ninstall-info: No such file or directory for /usr/share/info/wget.info.gz\n Cleanup : curl-7.29.0-51.el7.x86_64 8/13 \n Cleanup : epel-release-7-11.noarch 9/13 \n Cleanup : libcurl-7.29.0-51.el7.x86_64 10/13 \n Cleanup : libssh2-1.4.3-12.el7_6.2.x86_64 11/13 \n Cleanup : sudo-1.8.23-3.el7.x86_64 12/13 \n Cleanup : iproute-4.11.0-14.el7.x86_64 13/13 \n Verifying : curl-7.29.0-59.el7_9.1.x86_64 1/13 \n Verifying : libssh2-1.8.0-4.el7.x86_64 2/13 \n Verifying : wget-1.14-18.el7_6.1.x86_64 3/13 \n Verifying : iproute-4.11.0-30.el7.x86_64 4/13 \n Verifying : sudo-1.8.23-10.el7_9.1.x86_64 5/13 \n Verifying : libcurl-7.29.0-59.el7_9.1.x86_64 6/13 \n Verifying : epel-release-7-13.noarch 7/13 \n Verifying : sudo-1.8.23-3.el7.x86_64 8/13 \n Verifying : epel-release-7-11.noarch 9/13 \n Verifying : libssh2-1.4.3-12.el7_6.2.x86_64 10/13 \n Verifying : curl-7.29.0-51.el7.x86_64 11/13 \n Verifying : iproute-4.11.0-14.el7.x86_64 12/13 \n Verifying : libcurl-7.29.0-51.el7.x86_64 13/13 \n\nInstalled:\n wget.x86_64 0:1.14-18.el7_6.1 \n\nUpdated:\n curl.x86_64 0:7.29.0-59.el7_9.1 epel-release.noarch 0:7-13 \n iproute.x86_64 0:4.11.0-30.el7 sudo.x86_64 0:1.8.23-10.el7_9.1 \n\nDependency Updated:\n libcurl.x86_64 0:7.29.0-59.el7_9.1 libssh2.x86_64 0:1.8.0-4.el7 \n\nComplete!\n"]} | |
TASK [base : python] *********************************************************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "changes": {"installed": ["python3", "python3-pip", "python-devel"]}, "msg": "", "rc": 0, "results": ["Loaded plugins: fastestmirror, ovl\nLoading mirror speeds from cached hostfile\n * base: ftp.byfly.by\n * epel: mirror.datacenter.by\n * extras: ftp.byfly.by\n * updates: ftp.byfly.by\nResolving Dependencies\n--> Running transaction check\n---> Package python-devel.x86_64 0:2.7.5-90.el7 will be installed\n--> Processing Dependency: python(x86-64) = 2.7.5-90.el7 for package: python-devel-2.7.5-90.el7.x86_64\n--> Processing Dependency: python2-rpm-macros > 3-30 for package: python-devel-2.7.5-90.el7.x86_64\n--> Processing Dependency: python-rpm-macros > 3-30 for package: python-devel-2.7.5-90.el7.x86_64\n---> Package python3.x86_64 0:3.6.8-18.el7 will be installed\n--> Processing Dependency: python3-libs(x86-64) = 3.6.8-18.el7 for package: python3-3.6.8-18.el7.x86_64\n--> Processing Dependency: python3-setuptools for package: python3-3.6.8-18.el7.x86_64\n--> Processing Dependency: libpython3.6m.so.1.0()(64bit) for package: python3-3.6.8-18.el7.x86_64\n---> Package python3-pip.noarch 0:9.0.3-8.el7 will be installed\n--> Running transaction check\n---> Package python.x86_64 0:2.7.5-77.el7_6 will be updated\n---> Package python.x86_64 0:2.7.5-90.el7 will be an update\n--> Processing Dependency: python-libs(x86-64) = 2.7.5-90.el7 for package: python-2.7.5-90.el7.x86_64\n---> Package python-rpm-macros.noarch 0:3-34.el7 will be installed\n--> Processing Dependency: python-srpm-macros for package: python-rpm-macros-3-34.el7.noarch\n---> Package python2-rpm-macros.noarch 0:3-34.el7 will be installed\n---> Package python3-libs.x86_64 0:3.6.8-18.el7 will be installed\n--> Processing Dependency: libtirpc.so.1()(64bit) for package: python3-libs-3.6.8-18.el7.x86_64\n---> Package python3-setuptools.noarch 0:39.2.0-10.el7 will be installed\n--> Running transaction check\n---> Package libtirpc.x86_64 0:0.2.4-0.16.el7 will be installed\n---> Package python-libs.x86_64 0:2.7.5-77.el7_6 will be updated\n---> Package python-libs.x86_64 0:2.7.5-90.el7 will be an update\n---> Package python-srpm-macros.noarch 0:3-34.el7 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n python-devel x86_64 2.7.5-90.el7 updates 399 k\n python3 x86_64 3.6.8-18.el7 updates 70 k\n python3-pip noarch 9.0.3-8.el7 base 1.6 M\nInstalling for dependencies:\n libtirpc x86_64 0.2.4-0.16.el7 base 89 k\n python-rpm-macros noarch 3-34.el7 base 9.1 k\n python-srpm-macros noarch 3-34.el7 base 8.8 k\n python2-rpm-macros noarch 3-34.el7 base 8.1 k\n python3-libs x86_64 3.6.8-18.el7 updates 6.9 M\n python3-setuptools noarch 39.2.0-10.el7 base 629 k\nUpdating for dependencies:\n python x86_64 2.7.5-90.el7 updates 96 k\n python-libs x86_64 2.7.5-90.el7 updates 5.6 M\n\nTransaction Summary\n================================================================================\nInstall 3 Packages (+6 Dependent packages)\nUpgrade ( 2 Dependent packages)\n\nTotal download size: 15 M\nDownloading packages:\nNo Presto metadata available for updates\n--------------------------------------------------------------------------------\nTotal 5.8 MB/s | 15 MB 00:02 \nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n Updating : python-libs-2.7.5-90.el7.x86_64 1/13 \n Updating : python-2.7.5-90.el7.x86_64 2/13 \n Installing : python-srpm-macros-3-34.el7.noarch 3/13 \n Installing : python-rpm-macros-3-34.el7.noarch 4/13 \n Installing : python2-rpm-macros-3-34.el7.noarch 5/13 \n Installing : libtirpc-0.2.4-0.16.el7.x86_64 6/13 \n Installing : python3-setuptools-39.2.0-10.el7.noarch 7/13 \n Installing : python3-pip-9.0.3-8.el7.noarch 8/13 \n Installing : python3-3.6.8-18.el7.x86_64 9/13 \n Installing : python3-libs-3.6.8-18.el7.x86_64 10/13 \n Installing : python-devel-2.7.5-90.el7.x86_64 11/13 \n Cleanup : python-2.7.5-77.el7_6.x86_64 12/13 \n Cleanup : python-libs-2.7.5-77.el7_6.x86_64 13/13 \n Verifying : libtirpc-0.2.4-0.16.el7.x86_64 1/13 \n Verifying : python2-rpm-macros-3-34.el7.noarch 2/13 \n Verifying : python3-libs-3.6.8-18.el7.x86_64 3/13 \n Verifying : python-devel-2.7.5-90.el7.x86_64 4/13 \n Verifying : python-2.7.5-90.el7.x86_64 5/13 \n Verifying : python3-setuptools-39.2.0-10.el7.noarch 6/13 \n Verifying : python-srpm-macros-3-34.el7.noarch 7/13 \n Verifying : python-rpm-macros-3-34.el7.noarch 8/13 \n Verifying : python3-3.6.8-18.el7.x86_64 9/13 \n Verifying : python3-pip-9.0.3-8.el7.noarch 10/13 \n Verifying : python-libs-2.7.5-90.el7.x86_64 11/13 \n Verifying : python-2.7.5-77.el7_6.x86_64 12/13 \n Verifying : python-libs-2.7.5-77.el7_6.x86_64 13/13 \n\nInstalled:\n python-devel.x86_64 0:2.7.5-90.el7 python3.x86_64 0:3.6.8-18.el7 \n python3-pip.noarch 0:9.0.3-8.el7 \n\nDependency Installed:\n libtirpc.x86_64 0:0.2.4-0.16.el7 \n python-rpm-macros.noarch 0:3-34.el7 \n python-srpm-macros.noarch 0:3-34.el7 \n python2-rpm-macros.noarch 0:3-34.el7 \n python3-libs.x86_64 0:3.6.8-18.el7 \n python3-setuptools.noarch 0:39.2.0-10.el7 \n\nDependency Updated:\n python.x86_64 0:2.7.5-90.el7 python-libs.x86_64 0:2.7.5-90.el7 \n\nComplete!\n"]} | |
TASK [base : latest pip] ******************************************************* | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "cmd": ["pip", "install", "--upgrade", "pip"], "delta": "0:00:04.094078", "end": "2021-03-13 22:33:46.358724", "rc": 0, "start": "2021-03-13 22:33:42.264646", "stderr": "DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.", "stderr_lines": ["DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7."], "stdout": "Collecting pip\n Downloading https://files.pythonhosted.org/packages/27/79/8a850fe3496446ff0d584327ae44e7500daf6764ca1a382d2d02789accf7/pip-20.3.4-py2.py3-none-any.whl (1.5MB)\nInstalling collected packages: pip\n Found existing installation: pip 19.1\n Uninstalling pip-19.1:\n Successfully uninstalled pip-19.1\nSuccessfully installed pip-20.3.4", "stdout_lines": ["Collecting pip", " Downloading https://files.pythonhosted.org/packages/27/79/8a850fe3496446ff0d584327ae44e7500daf6764ca1a382d2d02789accf7/pip-20.3.4-py2.py3-none-any.whl (1.5MB)", "Installing collected packages: pip", " Found existing installation: pip 19.1", " Uninstalling pip-19.1:", " Successfully uninstalled pip-19.1", "Successfully installed pip-20.3.4"]} | |
TASK [base : Install pymysql] ************************************************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "cmd": ["/bin/pip2", "install", "pymysql"], "name": ["pymysql"], "requirements": null, "state": "present", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.\n", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Collecting pymysql\n Downloading PyMySQL-0.10.1-py2.py3-none-any.whl (47 kB)\nInstalling collected packages: pymysql\nSuccessfully installed pymysql-0.10.1\n", "stdout_lines": ["Collecting pymysql", " Downloading PyMySQL-0.10.1-py2.py3-none-any.whl (47 kB)", "Installing collected packages: pymysql", "Successfully installed pymysql-0.10.1"], "version": null, "virtualenv": null} | |
TASK [user : Create group mysqldb-check-test] ********************************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "gid": 1014, "name": "mysqldb-check-test", "state": "present", "system": false} | |
TASK [user : Create user mysqldb-check] **************************************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "comment": "", "create_home": true, "group": 1014, "home": "/opt/mysqldb-check", "name": "mysqldb-check", "shell": "/bin/sh", "state": "present", "system": false, "uid": 1014} | |
TASK [user : Give sudo privileges] ********************************************* | |
[0;36mskipping: [db-check] => {"changed": false, "skip_reason": "Conditional result was False"} | |
TASK [mysql_db_check : Make binary folder] ************************************* | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "gid": 1014, "group": "mysqldb-check-test", "mode": "0755", "owner": "mysqldb-check", "path": "/opt/mysqldb-check/bin", "size": 4096, "state": "directory", "uid": 1014} | |
TASK [mysql_db_check : Make config folder] ************************************* | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "gid": 1014, "group": "mysqldb-check-test", "mode": "0755", "owner": "mysqldb-check", "path": "/opt/mysqldb-check/conf", "size": 4096, "state": "directory", "uid": 1014} | |
TASK [mysql_db_check : Download bin file and set permissions] ****************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "checksum_dest": null, "checksum_src": "aa78532d520cf2f82ccc587af851596c0d17d08c", "dest": "/opt/mysqldb-check/bin/mysql-check", "elapsed": 1, "gid": 1014, "group": "mysqldb-check-test", "md5sum": "0b5a84cf51fcf79480b4f36b4c88153b", "mode": "0750", "msg": "OK (1818876 bytes)", "owner": "mysqldb-check", "size": 1818876, "src": "/root/.ansible/tmp/ansible-moduletmp-1615674832.18-Szezt0/tmpNMGNMt", "state": "file", "status_code": 200, "uid": 1014, "url": "https://playpit-labs-assets.s3-eu-west-1.amazonaws.com/mysql-check/mysql-check"} | |
TASK [mysql_db_check : Copy configuration files] ******************************* | |
[0;33mchanged: [db-check] => {"changed": true, "checksum": "ddac175155cd33f99921b6ba7d2757bc5e788f30", "dest": "/opt/mysqldb-check/conf/mysql_check.conf", "gid": 1014, "group": "mysqldb-check-test", "md5sum": "62ce1f99ceea71082d2ee6e95318fba3", "mode": "0644", "owner": "mysqldb-check", "size": 10, "src": "/root/.ansible/tmp/ansible_mitogen_action_9592611f762caa0b/source", "state": "file", "uid": 1014} | |
TASK [mysql_db_check : Copy UNIT] ********************************************** | |
[0;33mchanged: [db-check] => {"changed": true, "checksum": "0292034abf57ba6ee01075dc1d7e818805d89608", "dest": "/etc/systemd/system/mysql_check.service", "gid": 1014, "group": "mysqldb-check-test", "md5sum": "d4efee3c7f04be78c22228f1c4f205f6", "mode": "0644", "owner": "mysqldb-check", "size": 300, "src": "/root/.ansible/tmp/ansible_mitogen_action_c1676294d3288d05/source", "state": "file", "uid": 1014} | |
TASK [mysql_db_check : Check servicr] ****************************************** | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "enabled": true, "name": "mysql_check", "state": "started", "status": {"ActiveEnterTimestampMonotonic": "0", "ActiveExitTimestampMonotonic": "0", "ActiveState": "inactive", "After": "system.slice basic.target network.target systemd-journald.socket", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "no", "AssertTimestampMonotonic": "0", "Before": "shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "ConditionResult": "no", "ConditionTimestampMonotonic": "0", "Conflicts": "shutdown.target", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "MySQL checker", "DevicePolicy": "auto", "EnvironmentFile": "/opt/mysqldb-check/conf/mysql_check.conf (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "0", "ExecMainStartTimestampMonotonic": "0", "ExecMainStatus": "0", "ExecStart": "{ path=/opt/mysqldb-check/bin/mysql-check ; argv[]=/opt/mysqldb-check/bin/mysql-check ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "ExecStop": "{ path=/bin/kill ; argv[]=/bin/kill -s QUIT $MAINPID ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/etc/systemd/system/mysql_check.service", "Group": "mysqldb-check-test", "GuessMainPID": "yes", "IOScheduling": "4", "Id": "mysql_check.service", "IgnoreOnIsolate": "no", "IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestampMonotonic": "0", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "67108864", "LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "1048576", "LimitNPROC": "18446744073709551615", "LimitRSS": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "29790", "LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": "0", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": "mysql_check.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "Requires": "basic.target", "Restart": "no", "RestartUSec": "100ms", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitInterval": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "dead", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": "18446744073709551615", "TasksMax": "18446744073709551615", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "simple", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "disabled", "User": "mysqldb-check", "Wants": "system.slice", "WatchdogTimestampMonotonic": "0", "WatchdogUSec": "0"}} | |
TASK [mysql_db_check : Wait 30 sec and check port db] ************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "elapsed": 30, "match_groupdict": {}, "match_groups": [], "path": null, "port": 8080, "search_regex": null, "state": "started"} | |
PLAY RECAP ********************************************************************* | |
[0;33mdb-check : [0;32mok=15 [0;33mchanged=13 unreachable=0 failed=0 [0;36mskipped=1 rescued=0 ignored=0 | |
* About to connect() to localhost port 8080 (#0) | |
* Trying 127.0.0.1... | |
* Connected to localhost (127.0.0.1) port 8080 (#0) | |
> GET / HTTP/1.1 | |
> User-Agent: curl/7.29.0 | |
> Host: localhost:8080 | |
> Accept: */* | |
> | |
< HTTP/1.1 200 OK | |
< Date: Sat, 13 Mar 2021 22:34:30 GMT | |
< Content-Type: text/html; charset=utf-8 | |
< Transfer-Encoding: chunked | |
< | |
{ [data not shown] | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Testing DB Connectivity</title> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:300" > | |
<link rel="stylesheet" href="https://kit-free.fontawesome.com/releases/latest/css/free.min.css" media="all"> | |
<link rel="stylesheet" href="https://bootswatch.com/_vendor/bootstrap/dist/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://bootswatch.com/_vendor/bootstrap/dist/css/bootstrap.css"> | |
<link rel="stylesheet" href="https://kit-free.fontawesome.com/releases/latest/css/free.min.css" media="all"> | |
<script type="text/javascript" src="//code.jquery.com/jquery-latest.min.js"></script> | |
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> | |
<style> | |
body { | |
margin:0; | |
padding:0; | |
background-color:#303030; | |
} | |
div.main { | |
text-align: center; | |
} | |
div.main img { | |
margin: 40px 0; | |
} | |
div.content { | |
color: #f2f2f2; | |
position: absolute; | |
margin: auto; | |
width: 500px; | |
left: 50%; | |
margin-left: -250px; | |
top: 188px; | |
/* margin-top: -250px; */ | |
} | |
.content #message { | |
margin: 10px 0 50px 0; | |
padding: 30px 0; | |
font-family: 'Ubuntu', sans-serif; | |
font-weight: 300; | |
font-size: 32pt; | |
background-color: #505050; | |
border-top: 2px solid #909090; | |
border-bottom: 2px solid #909090; | |
} | |
.author { | |
text-align: right; | |
font-family: 'Ubuntu', sans-serif; | |
font-weight: 300; | |
font-size: 12pt; | |
} | |
.content #info { | |
margin: 0 auto; | |
font-family: 'Ubuntu', sans-serif; | |
font-weight: 300; | |
font-size: 12pt; | |
} | |
.content #info table { | |
margin: 10px auto; | |
} | |
.content #info table th { | |
text-align: right; | |
padding-right: 20px; | |
} | |
.content #info table td { | |
text-align: left; | |
} | |
fa, .far, .fas { | |
font-family: "Font Awesome 5 Pro"; | |
font-size: -webkit-xxx-large; | |
} | |
</style> | |
<script type="text/javascript"> | |
function checkBtnClick() { | |
$.post('/check', { | |
dbhostname: $("#dbhost_value").val(), | |
dbport: $("#dbport_value").val(), | |
dbname: $("#dbname_value").val(), | |
dbuser: $("#dbuser_value").val(), | |
dbuserpassword: $("#dbuserpassword_value").val() | |
}).done(function(data) { | |
$('#check-content').html("<i class='far fa-thumbs-up'></i><b style='font-family: Ubuntu,sans-serif; font-weight: 300;font-size: 28pt;'> Connected!</b>"); | |
$('#check-content').css('display', 'block'); | |
}).fail(function(data) { | |
console.log(data); | |
$('#check-content').css('display', 'block'); | |
$('#check-content').html("<i class='fas fa-exclamation-triangle'></i><b style='font-family: Ubuntu,sans-serif; font-weight: 300;font-size: 28pt;'> Failed!</b>"); | |
$('#check-content-error').html(data.responseText); | |
$('#check-content-error').css('display', 'block'); | |
}); | |
} | |
</script> | |
</head> | |
<body> | |
<div class="main"> | |
<!--form id="db_datta"--> | |
<img width="300" style="margin-top: -20px;" src="https://database-programmers.com/img/icons/icon-mysql.png" /> | |
<div class="content" name="check-content"> | |
<div style="font-size: 8pt; font-family: "Ubuntu""> | |
Developed by Siarhei Beliakou for <a href="https://github.com/sbeliakou/playpit-labs" target="_blank">playpit-labs</a> | |
</div> | |
<div class="input-group input-group-sm mb-3"> | |
<div class="input-group-prepend"> | |
<span class="input-group-text" id="dbhostname" style="width: 150px;">DB Hostname</span> | |
</div> | |
<input id="dbhost_value" type="text" class="form-control" aria-label="Sizing example input" aria-describedby="dbhostname"> | |
<div class="input-group-prepend"> | |
<span class="input-group-text" id="dbport">DB Port</span> | |
</div> | |
<input id="dbport_value" type="text" class="form-control" placeholder="3306" aria-label="Sizing example input" aria-describedby="dbport"> | |
</div> | |
<div class="input-group input-group-sm mb-3"> | |
<div class="input-group-prepend"> | |
<span class="input-group-text" id="dbname" style="width: 150px;">Data Base Name</span> | |
</div> | |
<input id="dbname_value" type="text" class="form-control" aria-label="Sizing example input" aria-describedby="dbname"> | |
</div> | |
<div class="input-group input-group-sm mb-3"> | |
<div class="input-group-prepend"> | |
<span class="input-group-text" id="dbuser" style="width: 150px;">DB User Name</span> | |
</div> | |
<input id="dbuser_value" type="text" class="form-control" aria-label="Sizing example input" aria-describedby="dbuser"> | |
</div> | |
<div class="input-group input-group-sm mb-3"> | |
<div class="input-group-prepend"> | |
<span class="input-group-text" id="dbuserpassword" style="width: 150px;">DB Password</span> | |
</div> | |
<input id="dbuserpassword_value" type="text" class="form-control" aria-label="Sizing example input" aria-describedby="dbuserpassword"> | |
</div> | |
<button name='checkMeBtn' class="btn btn-outline-light btn-rounded btn-block my-4 waves-effect z-depth-0" onclick="checkBtnClick();">Check Connection</button> | |
<div id='check-content' style='display: none;'>Placeholder</div> | |
<div id='check-content-error' style='display: none;'>Placeholder</div> | |
</div> | |
<!--/form--> | |
</div> | |
</body> | |
</html> | |
* Connection #0 to host localhost left intact | |
2021/03/13 22:36:05 ✓ [2.3 MySQL DB Check] => rollout (Not ROOT) (1), 1m35.048s | |
2021/03/13 22:36:58 ✗ [2.3 MySQL DB Check] -> idempotency check (Not ROOT) | |
2021/03/13 22:36:58 Result: exit status 1 | |
2021/03/13 22:36:58 Output: | |
(run, /tmp/students-2/anton_antanovich/day2/2.3) => ansible-playbook testing-role-mysqldb-check.yml -i db-check, -v -u devops | |
rc: 0 | |
output: | | |
[0;34mUsing /tmp/students-2/anton_antanovich/day2/2.3/ansible.cfg as config file | |
PLAY [db-check] **************************************************************** | |
TASK [base : Check facts directory] ******************************************** | |
[0;32mok: [db-check] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/etc/ansible/facts.d", "size": 4096, "state": "directory", "uid": 0} | |
TASK [base : Gathering facts] ************************************************** | |
[0;32mok: [db-check] | |
TASK [base : epel-release installer] ******************************************* | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "changes": {"installed": [], "updated": []}, "msg": "", "rc": 0, "results": ["All packages providing epel-release are up to date", "All packages providing curl are up to date", "All packages providing wget are up to date", "All packages providing sudo are up to date", "All packages providing iproute are up to date", ""]} | |
TASK [base : python] *********************************************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "msg": "", "rc": 0, "results": ["python3-3.6.8-18.el7.x86_64 providing python3 is already installed", "python3-pip-9.0.3-8.el7.noarch providing python3-pip is already installed", "python-devel-2.7.5-90.el7.x86_64 providing python-devel is already installed"]} | |
TASK [base : latest pip] ******************************************************* | |
[0;33mchanged: [db-check] => {"ansible_facts": {}, "changed": true, "cmd": ["pip", "install", "--upgrade", "pip"], "delta": "0:00:01.173509", "end": "2021-03-13 22:36:18.294617", "rc": 0, "start": "2021-03-13 22:36:17.121108", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)", "stdout_lines": ["Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (20.3.4)"]} | |
TASK [base : Install pymysql] ************************************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "cmd": ["/bin/pip2", "install", "pymysql"], "name": ["pymysql"], "requirements": null, "state": "present", "stderr": "DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.\n", "stderr_lines": ["DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality."], "stdout": "Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)\n", "stdout_lines": ["Requirement already satisfied: pymysql in /usr/lib/python2.7/site-packages (0.10.1)"], "version": null, "virtualenv": null} | |
TASK [user : Create group mysqldb-check] *************************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "gid": 1014, "name": "mysqldb-check", "state": "present", "system": false} | |
TASK [user : Create user mysqldb-check] **************************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "append": false, "changed": false, "comment": "", "group": 1014, "home": "/opt/mysqldb-check", "move_home": false, "name": "mysqldb-check", "shell": "/bin/sh", "state": "present", "uid": 1014} | |
TASK [user : Give sudo privileges] ********************************************* | |
[0;36mskipping: [db-check] => {"changed": false, "skip_reason": "Conditional result was False"} | |
TASK [mysql_db_check : Make binary folder] ************************************* | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "gid": 1014, "group": "mysqldb-check", "mode": "0755", "owner": "mysqldb-check", "path": "/opt/mysqldb-check/bin", "size": 4096, "state": "directory", "uid": 1014} | |
TASK [mysql_db_check : Make config folder] ************************************* | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "gid": 1014, "group": "mysqldb-check", "mode": "0755", "owner": "mysqldb-check", "path": "/opt/mysqldb-check/conf", "size": 4096, "state": "directory", "uid": 1014} | |
TASK [mysql_db_check : Download bin file and set permissions] ****************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "checksum_dest": null, "checksum_src": null, "dest": "/opt/mysqldb-check/bin/mysql-check", "elapsed": 0, "gid": 1014, "group": "mysqldb-check", "mode": "0750", "msg": "file already exists", "owner": "mysqldb-check", "size": 1818876, "state": "file", "uid": 1014, "url": "https://playpit-labs-assets.s3-eu-west-1.amazonaws.com/mysql-check/mysql-check"} | |
TASK [mysql_db_check : Copy configuration files] ******************************* | |
[0;32mok: [db-check] => {"changed": false, "checksum": "ddac175155cd33f99921b6ba7d2757bc5e788f30", "dest": "/opt/mysqldb-check/conf/mysql_check.conf", "gid": 1014, "group": "mysqldb-check", "mode": "0644", "owner": "mysqldb-check", "path": "/opt/mysqldb-check/conf/mysql_check.conf", "size": 10, "state": "file", "uid": 1014} | |
TASK [mysql_db_check : Copy UNIT] ********************************************** | |
[0;32mok: [db-check] => {"changed": false, "checksum": "c1c9133bac378237ba88d67c8e3a2caddc091150", "dest": "/etc/systemd/system/mysql_check.service", "gid": 1014, "group": "mysqldb-check", "mode": "0644", "owner": "mysqldb-check", "path": "/etc/systemd/system/mysql_check.service", "size": 295, "state": "file", "uid": 1014} | |
TASK [mysql_db_check : Check servicr] ****************************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "enabled": true, "name": "mysql_check", "state": "started", "status": {"ActiveEnterTimestamp": "Sat 2021-03-13 22:35:33 UTC", "ActiveEnterTimestampMonotonic": "352826683209", "ActiveExitTimestampMonotonic": "0", "ActiveState": "active", "After": "basic.target systemd-journald.socket network.target system.slice", "AllowIsolate": "no", "AmbientCapabilities": "0", "AssertResult": "yes", "AssertTimestamp": "Sat 2021-03-13 22:35:33 UTC", "AssertTimestampMonotonic": "352826681743", "Before": "shutdown.target multi-user.target", "BlockIOAccounting": "no", "BlockIOWeight": "18446744073709551615", "CPUAccounting": "no", "CPUQuotaPerSecUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", "CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "18446744073709551615", "ConditionResult": "yes", "ConditionTimestamp": "Sat 2021-03-13 22:35:33 UTC", "ConditionTimestampMonotonic": "352826681742", "Conflicts": "shutdown.target", "ControlGroup": "/docker/fe4a9f83f3985627a2272b537afede89ae0b3355c6377138e9fbbd351d0cd2c5/system.slice/mysql_check.service", "ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", "Description": "MySQL checker", "DevicePolicy": "auto", "EnvironmentFile": "/opt/mysqldb-check/conf/mysql_check.conf (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "2342", "ExecMainStartTimestamp": "Sat 2021-03-13 22:35:33 UTC", "ExecMainStartTimestampMonotonic": "352826683120", "ExecMainStatus": "0", "ExecStart": "{ path=/opt/mysqldb-check/bin/mysql-check ; argv[]=/opt/mysqldb-check/bin/mysql-check ; ignore_errors=no ; start_time=[Sat 2021-03-13 22:35:33 UTC] ; stop_time=[n/a] ; pid=2342 ; code=(null) ; status=0/0 }", "ExecStop": "{ path=/bin/kill ; argv[]=/bin/kill -s QUIT $MAINPID ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/etc/systemd/system/mysql_check.service", "Group": "mysqldb-check", "GuessMainPID": "yes", "IOScheduling": "4", "Id": "mysql_check.service", "IgnoreOnIsolate": "no", "IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestamp": "Sat 2021-03-13 22:35:33 UTC", "InactiveExitTimestampMonotonic": "352826683209", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": "control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", "LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", "LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", "LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "67108864", "LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "1048576", "LimitNPROC": "18446744073709551615", "LimitRSS": "18446744073709551615", "LimitRTPRIO": "0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "29790", "LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": "2342", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", "MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": "mysql_check.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "PrivateDevices": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "Requires": "basic.target", "Restart": "no", "RestartUSec": "100ms", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "inherit", "StandardInput": "null", "StandardOutput": "journal", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitInterval": "10000000", "StartupBlockIOWeight": "18446744073709551615", "StartupCPUShares": "18446744073709551615", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "running", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": "18446744073709551615", "TasksMax": "18446744073709551615", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "simple", "UMask": "0022", "UnitFilePreset": "disabled", "UnitFileState": "enabled", "User": "mysqldb-check", "WantedBy": "multi-user.target", "Wants": "system.slice", "WatchdogTimestamp": "Sat 2021-03-13 22:35:33 UTC", "WatchdogTimestampMonotonic": "352826683172", "WatchdogUSec": "0"}} | |
TASK [mysql_db_check : Wait 30 sec and check port db] ************************** | |
[0;32mok: [db-check] => {"ansible_facts": {}, "changed": false, "elapsed": 30, "match_groupdict": {}, "match_groups": [], "path": null, "port": 8080, "search_regex": null, "state": "started"} | |
PLAY RECAP ********************************************************************* | |
[0;33mdb-check : [0;32mok=15 [0;33mchanged=1 unreachable=0 failed=0 [0;36mskipped=1 rescued=0 ignored=0 | |
Stdout Assertion Failed (Partial, 'changed=0') | |
2021/03/13 22:36:59 ----------------------------------------------------------------------------------- | |
2021/03/13 22:36:59 Tests Summary: | |
2021/03/13 22:36:59 10 (of 16) tests passed, 6 tests failed; rated as 62.50% | |
2021/03/13 22:36:59 | |
2021/03/13 22:36:59 Time Spent: 14m26.904s | |
2021/03/13 22:36:59 ----------------------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment