|
58 | 58 | name: "ntp"
|
59 | 59 | state: started
|
60 | 60 | enabled: true
|
| 61 | + when: "{{enableNTP}}" |
| 62 | + |
61 | 63 | tags:
|
62 | 64 | - section2
|
63 | 65 | - level_1_server
|
|
72 | 74 | # This recommendation only applies if timesyncd is in use on the system
|
73 | 75 | # Only one time synchronization method should be in use on the system
|
74 | 76 | - name: 2.2.1.2 Ensure systemd-timesyncd is configured
|
75 |
| - debug: |
76 |
| - msg: Skip this, since we are using ntp |
| 77 | + block: |
| 78 | + - name: 2.2.1.2 Ensure systemd-timesyncd is configured | install systemd-timesyncd |
| 79 | + apt: |
| 80 | + name: systemd-timesyncd |
| 81 | + state: present |
| 82 | + - name: 2.2.1.2 Ensure systemd-timesyncd is configured | set timezone |
| 83 | + timezone: |
| 84 | + name: "{{ timesync_timezone }}" |
| 85 | + - name: 2.2.1.2 Ensure systemd-timesyncd is configured | Configure systemd-timesyncd |
| 86 | + template: |
| 87 | + src: files/templates/timesyncd.conf.j2 |
| 88 | + dest: /etc/systemd/timesyncd.conf |
| 89 | + mode: 0644 |
| 90 | + owner: root |
| 91 | + group: root |
| 92 | + notify: reloadTimesyncd |
| 93 | + - name: 2.2.1.2 Ensure systemd-timesyncd is configured | Start and enable systemd-timesyncd |
| 94 | + service: |
| 95 | + name: systemd-timesyncd.service |
| 96 | + enabled: yes |
| 97 | + state: started |
| 98 | + when: "{{enable_systemdtimesyncd}} == True" |
77 | 99 | tags:
|
78 | 100 | - section2
|
79 | 101 | - level_1_server
|
80 | 102 | - level_1_workstation
|
81 | 103 | - 2.2.1.2
|
82 | 104 | # 2.2.1.3 Ensure chrony is configured
|
83 | 105 | - name: 2.2.1.3 Ensure chrony is configured
|
84 |
| - debug: |
85 |
| - msg: Skip this, since we are using ntp |
| 106 | + block: |
| 107 | + - name: 2.2.1.3 Ensure chrony is configured | Install Chrony |
| 108 | + apt: |
| 109 | + name: "chrony" |
| 110 | + state: present |
| 111 | + - name: 2.2.1.3 Ensure chrony is configured | Start Chrony service |
| 112 | + service: |
| 113 | + name: "chrony" |
| 114 | + state: started |
| 115 | + enabled: yes |
| 116 | + - name: 2.2.1.3 Ensure chrony is configured | Generate configuration |
| 117 | + template: |
| 118 | + src: files/templates/chrony.conf.j2 |
| 119 | + dest: "/etc/chrony/chrony.conf" |
| 120 | + owner: root |
| 121 | + group: root |
| 122 | + mode: 0644 |
| 123 | + notify: RestartChronyservice |
| 124 | + when: "{{chronyEnable}} == True" |
86 | 125 | tags:
|
87 | 126 | - section2
|
88 | 127 | - level_1_server
|
|
452 | 491 | msg: >
|
453 | 492 | Run the following command:
|
454 | 493 | $ lsof -i -P -n | grep -v "(ESTABLISHED)"
|
455 |
| - Review the output to ensure that all services listed are required on the system. If a listed |
456 |
| - service is not required, remove the package containing the service. If the package |
457 |
| - containing a non-essential service is required, stop and mask the non-essential service. |
| 494 | + Review the output to ensure that all services listed are required on the system. If a listed |
| 495 | + service is not required, remove the package containing the service. If the package |
| 496 | + containing a non-essential service is required, stop and mask the non-essential service. |
| 497 | + Code Meaning |
| 498 | + S File size differs. |
| 499 | + M File mode differs (includes permissions and file type). |
| 500 | + 5 The MD5 checksum differs. |
| 501 | + D The major and minor version numbers differ on a device file. |
| 502 | + L A mismatch occurs in a link. |
| 503 | + U The file ownership differs. |
| 504 | + G The file group owner differs. |
| 505 | + T The file time (mtime) differs. |
458 | 506 | tags:
|
459 | 507 | - section2
|
460 | 508 | - level_1_server
|
|
0 commit comments