forked from projectatomic/atomic-host-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yml
1108 lines (955 loc) · 27.8 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
# vim: set ft=ansible:
#
# !!!NOTE!!! This playbook was tested using Ansible 2.2; it is recommended
# that the same version is used.
#
# This playbook is actually multiple playbooks contained in a single file.
# I had to take this approach, because I encountered difficulties re-using
# the same roles with non-unique variables. Sometimes the roles would be
# executed with the use of the 'always' tag, sometimes not.
#
# The wrinkle in this approach is that sharing global variables across the
# multiple playbooks requires the use of a file containing the variables
# which is included in each playbook with the 'vars_files' directive.
#
# The sanity tests performed in this set of playbooks:
# - check permissions on /tmp are correct (RHBZ 1276775) after each reboot
# - add user to system, verify it is present after upgrade
# - make changes to /etc, verify changes are present after upgrade
# - add directory/file to /var, verify they persist after upgrade/rollback
# - add user post-upgrade, verify it is not present after rollback
# - add directory/file to /var post-upgrade, verify they persist after
# rollback
#
# The intent is to expand the sanity test coverage in this set of playbooks
# with small, focused tests going forward. Additional functional tests that
# are more expansive should be handled in separate playbooks.
#
- name: Improved Sanity Test - Pre-Upgrade
hosts: "{{ subjects | default('all') }}"
become: true
force_handlers: true
tags:
- atomic
- pre_upgrade
vars_files:
- "vars/common.yml"
roles:
- role: ansible_version_check
tags:
- ansible_version_check
- rhcos
# Set up handler notification
- role: handler_notify_on_failure
handler_name: h_get_journal
tags:
- handler_notify_on_failure
- rhcos
# Ensure the host(s) are indeed Atomic Host(s)
- role: atomic_host_check
tags:
- atomic_host_check
- rhcos
# Before we do anything substantial, let's check the journal to see if
# anything blew up on boot
- role: journal_fatal_msgs
tags:
- journal_fatal_msgs_first_boot
- journal_fatal_msgs
- rhcos
# https://bugzilla.redhat.com/show_bug.cgi?id=1571264
- role: ostree_admin_status
tags:
- ostree_admin_status
- rhcos
# Check RPM signatures
- role: rpm_signature_verify
tags:
- rpm_signature_verify
# Subscribe if the system is RHEL
- when: ansible_distribution == 'RedHat'
role: redhat_subscription
tags:
- redhat_subscription
# The 'archive' option will drop a YAML file into the playbook directory
# with the value of the original checksum, refspec, and remote
- role: booted_deployment_set_fact
archive: true
tags:
- booted_deployment_set_fact
- rhcos
# Setup local branch and upgrade right away so packages are layered on
# top of the local branch. If the local branch is created before the
# upgrade later in the test, it will only contain the origin content
# of the ostree.
- role: local_branch_setup
branch_name: local-branch
tags:
- local_branch_setup
- rhcos
# Commit to the local branch
- role: local_branch_commit
branch_name: local-branch
refspec: local-branch
version: test1
tags:
- local_branch_commit
- rhcos
# Modify the origin file so we can use rpm-ostree directly
- role: origin_file_modify
refspec: local-branch
tags:
- origin_file_modify
- rhcos
# Do the actual upgrade
- role: rpm_ostree_upgrade
tags:
- rpm_ostree_upgrade_setup
- rhcos
# Reboot the host and don't continue until expected services have started
- role: reboot
wait_for_services:
- docker
tags:
- reboot_setup
- rhcos
# Set some facts that are used in multiple roles
- role: osname_set_fact
tags:
- osname_set_fact
- rhcos
# TEST
# Verify that rpm-ostree can be run as non-root or sudo
- role: command_privilege_verify
cmd: rpm-ostree status
user: bin
expect_failure: false
tags:
- command_privilege_verify
- rhcos
# TEST
# Verify that the output from 'atomic host status'
# matches 'rpm-ostree status'
- role: atomic_host_status_verify
tags:
- atomic_host_status_verify
# TEST
# Verify SELinux labels are correct
- role: selinux_verify
tags:
- selinux_verify
- rhcos
# TEST
# Verify that SELinux file contexts can be modified
- role: semanage_fcontext_mod
test_dir_match: "{{ g_semanage_test_dir_match }}"
test_context: "{{ g_semanage_test_context }}"
tags:
- semanage_fcontext_mod
- rhcos
# Sets the selinux context of test_dir
- name: semanage_fcontext_verify
test_dir: "{{ g_semanage_test_dir }}"
test_context: "{{ g_semanage_test_context }}"
tags:
- semanage_fcontext_verify
- rhcos
# Sets boolean defined in vars
- role: selinux_boolean
tags:
- selinux_boolean
- rhcos
# TEST
# Verify that 'firewalld' is correctly installed/configured
- role: firewalld_service_verify
tags:
- firewalld_service_verify
# TEST
# Verify that the Docker storage defaults are correct
- role: docker_storage_verify
tags:
- docker_storage_verify
- rhcos
# TEST
# Verify that 'docker pull' is successful. (Note: this is a different
# operation than 'atomic pull')
- role: docker_pull_run_remove
tags:
- docker_pull_run_remove
- rhcos
# TEST
# Verify that basic `podman` operations are successful.
- role: podman_pull_run_remove
tags:
- podman_pull_run_remove
- rhcos
# TEST
# Validate 'atomic pull', 'atomic scan' works correctly.
# Remove images after test of each command.
# Do this ahead of 'ostree admin unlock' because of overlay + SELinux
# incompatibility on RHEL. (This should be fixed in 7.4)
- role: atomic_pull_verify
tags:
- atomic_pull_verify
# Clean up docker images
- role: docker_remove_all
tags:
- docker_remove_all
- rhcos
# TEST
# Validate atomic scan command
- when: ansible_distribution == 'RedHat'
role: atomic_scan_verify
tags:
- atomic_scan_verify
# Clean up docker images
- role: docker_remove_all
tags:
- docker_remove_all
- rhcos
# Install package using package layering
- role: rpm_ostree_install
roi_packages: "{{ g_pkg }}"
roi_reboot: false
tags:
- rpm_ostree_install
# Reboot the host and don't continue until expected services have started
- role: reboot
wait_for_services:
- docker
tags:
- reboot_pre_up_install
# TEST
# Verify that the package layering worked
- role: rpm_ostree_install_verify
roiv_package_name: "{{ g_pkg }}"
roiv_binary_name: "{{ g_pkg }}"
tags:
- rpm_ostree_install_verify
# TEST
# Verify admin unlock by installing an RPM
- role: ostree_admin_unlock_hotfix
tags:
- ostree_admin_unlock_hotfix
- rhcos
# TEST
# Verify overlayfs is present
- role: overlayfs_verify_present
tags:
- overlayfs_verify_present
- rhcos
# Install an rpm using the rpm command
- role: rpm_install
rpm_path: "{{ g_rpm_path }}"
tags:
- rpm_install
- rhcos
# TEST
# Verify the rpm installed successfully when unlocked
- role: package_verify_present
rpm_name: "{{ g_rpm_name }}"
check_binary: false
tags:
- package_verify_present
- rhcos
# TEST
# Verify that /tmp has the proper permissions
- role: tmp_check_perms
tags:
- tmp_check_perms
- rhcos
# TEST
# Verify that the RPM database is functional
- role: rpmdb_verify
tags:
- rpmdb_verify
- rhcos
# Add users, make changes to /etc, and add things to /var before the
# the system is upgraded
- role: user_add
ua_uid: "{{ g_uid1 }}"
tags:
- user_add
- rhcos
# TEST
# Verify the user created is present
- role: user_verify_present
uvp_uid: "{{ g_uid1 }}"
tags:
- user_verify_present
- rhcos
# Modify etc
- role: etc_modify
tags:
- etc_modify
- rhcos
# TEST
# Verify that the changes to etc persisted
- role: etc_verify_changes
tags:
- etc_verify_changes
- rhcos
# Add files to var
- role: var_add_files
vaf_filename: "{{ g_file1 }}"
vaf_dirname: "{{ g_dir1 }}"
tags:
- var_add_files
- rhcos
# TEST
# Verify the files added to var persisted
- role: var_files_present
vfp_filename: "{{ g_file1 }}"
vfp_dirname: "{{ g_dir1 }}"
tags:
- var_files_present
- rhcos
# Pull down docker base images, build a layered image, run it, then
# remove the container. But we keep the image around to run later.
# Run 'atomic run/stop' tests prior to running 'docker run' test so
# the built images can be run later.
- role: docker_pull_base_image
tags:
- docker_pull_base_image
- rhcos
# Build a local httpd image
- role: docker_build
db_src: "roles/docker_build/files/{{ g_osname }}/httpd/"
db_image_name: "{{ g_httpd_name }}"
tags:
- docker_build
# TEST
# Verify we can run a container via atomic
- role: atomic_run_verify
container: "{{ g_httpd_name }}"
tags:
- atomic_run_verify
# TEST
# Verify we can stop a container via atomic
- role: atomic_stop_verify
container: "{{ g_httpd_name }}"
tags:
- atomic_stop_verify
#####
# TEST
# Verify we can remove the httpd container and it is no longer running
- role: docker_rm_container
drc_container_name: "{{ g_httpd_name }}"
tags:
- docker_rm_container
# TEST
# Verify we can run the container again
- role: docker_run
dr_image_name: "{{ g_httpd_name }}"
dr_run_options: "-d -p 80:80"
tags:
- docker_run
# TEST
# Verify port 80 is open and we can retrieve the URL
- role: check_open_port
cop_port: "80"
cop_url: "http://localhost:80"
tags:
- check_open_port
# TEST
# Verify we can remove the httpd container and it is no longer running
- role: docker_rm_container
drc_container_name: "{{ g_httpd_name }}"
tags:
- docker_rm_container_again
# Configure container_manage_cgroup boolean
# See - https://bugzilla.redhat.com/show_bug.cgi?id=1510139
# - https://bugzilla.redhat.com/show_bug.cgi?id=1554881
# - https://bugzilla.redhat.com/show_bug.cgi?id=1553803
- role: selinux_boolean
g_seboolean: "container_manage_cgroup"
tags:
- container_manage_cgroup_bool
- non_priv_systemd_httpd_container
- rhcos
# TEST
# Build non-priviledged systemd httpd container
- role: docker_build
db_src: "roles/docker_build/files/{{ g_osname }}/systemd_httpd/"
db_image_name: "{{ g_osname }}_systemd_httpd"
tags:
- docker_build_systemd
- non_priv_systemd_httpd_container
# TEST
# Run non-privileged systemd httpd container
- role: docker_run
dr_image_name: "{{ g_osname }}_systemd_httpd"
dr_run_options: "-d -p 80:80"
tags:
- docker_run_systemd
- non_priv_systemd_httpd_container
# TEST
# Verify that port 80 is open and the URL is accessible
- role: check_open_port
cop_port: "80"
cop_url: "http://localhost:80/"
tags:
- check_open_port_systemd
- non_priv_systemd_httpd_container
# TEST
# Remove the non-privileged systemd httpd container
- role: docker_rm_container
drc_container_name: "{{ g_osname }}_systemd_httpd"
tags:
- docker_rm_container_systemd
- non_priv_systemd_httpd_container
# TEST
# Install, run and uninstall cockpit using atomic command
- role: atomic_installation_verify
tags:
- atomic_installation_verify
# new commit
- role: local_branch_commit
branch_name: local-branch
refspec: local-branch
version: test2
tags:
- local_branch_commit
- rhcos
check_mode: false
# TEST
# Verify installation of etcd system container works
- role: etcd_sys_container_install
tags:
- etcd_sys_container_install
# Upgrade host
- role: rpm_ostree_upgrade
tags:
- rpm_ostree_upgrade
- rhcos
check_mode: false
# Before we reboot, check the journal for anything that blew up
- role: journal_fatal_msgs
tags:
- journal_fatal_msgs_reboot
- journal_fatal_msgs
- rhcos
- role: reboot
wait_for_services:
- docker
tags:
- reboot_pre_upgrade
- rhcos
# ---
- name: Improved Sanity Test - Post-Upgrade
hosts: "{{ subjects | default('all') }}"
become: true
force_handlers: true
tags:
- atomic
- post_upgrade
vars_files:
- "vars/common.yml"
- ["vars/{{ ansible_distribution|lower }}.yml", "vars/os_defaults.yml"]
roles:
- role: ansible_version_check
tags:
- ansible_version_check
- rhcos
- role: handler_notify_on_failure
handler_name: h_get_journal
tags:
- handler_notify_on_failure
- rhcos
check_mode: false
- role: atomic_host_check
tags:
- atomic_host_check
- rhcos
# Setup facts again. (Need to use the 'check_mode: false' option to ensure the
# role runs again)
- role: osname_set_fact
tags:
- osname_set_fact
- rhcos
check_mode: false
# Before we do any additional actions, let's check the journal to see if
# anything blew up after reboot
- role: journal_fatal_msgs
tags:
- journal_fatal_msgs_second_boot
- journal_fatal_msgs
- rhcos
# https://bugzilla.redhat.com/show_bug.cgi?id=1571264
- role: ostree_admin_status
tags:
- ostree_admin_status_again
- rhcos
# We remove any subscriptions after the upgrade to verify that
# 'rpm-ostree status' with the 'unconfigured-state' field present.
# https://bugzilla.redhat.com/show_bug.cgi?id=1421867
- when: ansible_distribution == 'RedHat'
role: redhat_unsubscribe
unconfigured_state: true
tags:
- redhat_unsubscribe
# Verify that rpm-ostree can be run as non-root or sudo
- role: command_privilege_verify
cmd: rpm-ostree status
user: bin
expect_failure: false
tags:
- command_privilege_verify
- rhcos
# Compare 'atomic host status' and 'rpm-ostree status' again
- role: atomic_host_status_verify
stop_daemon: true
tags:
- atomic_host_status_verify
# Re-subscribe
- when: ansible_distribution == 'RedHat'
role: redhat_subscription
tags:
- redhat_subscription
# Verify correct SELinux labels again
- role: selinux_verify
tags:
- selinux_verify
- rhcos
# Verify the change to the SELinux file context persisted
- role: semanage_fcontext_verify
test_dir: "{{ g_semanage_test_dir }}"
test_context: "{{ g_semanage_test_context }}"
tags:
- semanage_fcontext_verify
- rhcos
# Verify the SELinux boolean changes
- role: selinux_boolean_verify
tags:
- selinux_boolean_verify
- rhcos
# TEST
# Verify that 'firewalld' is correctly installed/configured
- role: firewalld_service_verify
tags:
- firewalld_service_verify
# Verify that the Docker storage defaults haven't changed
- role: docker_storage_verify
tags:
- docker_storage_verify
- rhcos
- role: docker_pull_run_remove
tags:
- docker_pull_run_remove
- rhcos
- role: podman_pull_run_remove
tags:
- podman_pull_run_remove
- rhcos
# Check layered package is still installed
- role: rpm_ostree_install_verify
roiv_package_name: "{{ g_pkg }}"
roiv_binary_name: "{{ g_pkg }}"
tags:
- rpm_ostree_install_verify
# Check etcd system container is still running
- role: command
cmd: systemctl status etcd
output: 'active (running)'
tags:
- command
# Uninstall etcd system container
- role: atomic_system_uninstall
asu_name: etcd
tags:
- atomic_system_uninstall
# Verify etcd system container uninstall
- role: atomic_system_uninstall_verify
asuv_image: etcd
tags:
- atomic_system_uninstall_verify
# Install etcd system container
- role: etcd_sys_container_install
delete_key: true
tags:
- etcd_sys_container_install
- cloud_image
check_mode: false
# Uninstall etcd system container
- role: atomic_system_uninstall
asu_name: etcd
tags:
- atomic_system_uninstall
- cloud_image
check_mode: false
# Verify etcd system container uninstall
- role: atomic_system_uninstall_verify
asuv_image: etcd
tags:
- atomic_system_uninstall_verify
- cloud_image
# Install a package via rpm-ostree
- role: rpm_ostree_install
roi_packages: "{{ g_ros_install_pkg }}"
roi_reboot: false
tags:
- rpm_ostree_install
# Reboot the host and don't continue until expected services have started
- role: reboot
tags:
- reboot_post_up_install
# TEST
# Verify that the previously installed package is present
- role: rpm_ostree_install_verify
roiv_package_name: "{{ g_pkg }}"
roiv_binary_name: "{{ g_pkg }}"
tags:
- rpm_ostree_install_verify
# TEST
# Verify that the rpm-ostree installed package is present
- role: rpm_ostree_install_verify
roiv_package_name: "{{ g_ros_install_pkg }}"
roiv_binary_name: "{{ g_ros_install_bin }}"
tags:
- rpm_ostree_install_verify
# Start httpd
- when: ansible_distribution != 'CentOS'
role: httpd_start
httpd_port: 8080
tags:
- httpd_start
# Verify that httpd is serving on port 8080
- when: ansible_distribution != 'CentOS'
role: url_verify
url: http://localhost:8080
destination: /dev/null
tags:
- url_verify
# TEST
# Check admin unlock overlayfs is no longer there after upgrade
- role: overlayfs_verify_missing
tags:
- overlayfs_verify_missing
- rhcos
# TEST
# Verify admin unlocked package is removed after upgrade
- role: package_verify_missing
rpm_name: "{{ g_rpm_name }}"
tags:
- package_verify_missing
- rhcos
# TEST
# Check that /tmp is properly setup again
- role: tmp_check_perms
tags:
- tmp_check_perms
- rhcos
# TEST
# Check that the RPM database is functional again
- role: rpmdb_verify
tags:
- rpmdb_verify
- rhcos
# TEST
# Verify that the new users, /etc changes, and /var additions are still
# present after the upgrade
- role: user_verify_present
uvp_uid: "{{ g_uid1 }}"
tags:
- user_verify_present
- rhcos
- role: etc_verify_changes
tags:
- etc_verify_changes
- rhcos
- role: var_files_present
vfp_filename: "{{ g_file1 }}"
vfp_dirname: "{{ g_dir1 }}"
tags:
- var_files_present
- rhcos
# Add more users and more files to /var ahead of the rollback
- role: user_add
ua_uid: "{{ g_uid2 }}"
tags:
- user_add
- rhcos
# TEST
# Ensure the user we just added is present
- role: user_verify_present
uvp_uid: "{{ g_uid2 }}"
tags:
- user_verify_present
- rhcos
# Add some files to var
- role: var_add_files
vaf_filename: "{{ g_file2 }}"
vaf_dirname: "{{ g_dir2 }}"
tags:
- var_add_files
- rhcos
# TEST
# Ensure the files we added var are present
- role: var_files_present
vfp_filename: "{{ g_file2 }}"
vfp_dirname: "{{ g_dir2 }}"
tags:
- var_files_present
- rhcos
# TEST
# Install, run and uninstall cockpit using atomic command
- role: atomic_installation_verify
tags:
- atomic_installation_verify
# TEST
# Run the previously created docker layered image, then remove
# the container and the image.
- role: atomic_run_verify
container: "{{ g_httpd_name }}"
tags:
- atomic_run_verify
# TEST
# Ensure we are able to stop the httpd container
- role: atomic_stop_verify
container: "{{ g_httpd_name }}"
tags:
- atomic_stop_verify
# Remove the httpd container
- role: docker_rm_container
drc_container_name: "{{ g_httpd_name }}"
tags:
- docker_rm_container
# Remove the httpd image
- role: docker_rmi
drmi_image_name: "{{ g_httpd_name }}"
tags:
- docker_rmi
# TEST
# Verify we can start the non-privileged systemd httpd container
- role: docker_run
dr_image_name: "{{ g_osname }}_systemd_httpd"
dr_run_options: "-d -p 80:80"
tags:
- docker_run_systemd
- non_priv_systemd_httpd_container
# Verify that port 80 is open and URL is accessible
- role: check_open_port
cop_port: "80"
cop_url: "http://localhost:80/"
tags:
- check_open_port_systemd
- non_priv_systemd_httpd_container
# Remove the systemd httpd container
- role: docker_rm_container
drc_container_name: "{{ g_osname }}_systemd_httpd"
tags:
- docker_rm_container_systemd
- non_priv_systemd_httpd_container
# Remove all things docker
- role: docker_remove_all
tags:
- docker_remove_all
- rhcos
# TEST
# Validate atomic pull works
- role: atomic_pull_verify
tags:
- atomic_pull_verify
# Clean up docker files
- role: docker_remove_all
tags:
- docker_remove_all
- rhcos
# TEST
# Validate atomic scan works
- when: ansible_distribution == 'RedHat'
role: atomic_scan_verify
tags:
- atomic_scan_verify
# Rollback and reboot
- role: rpm_ostree_rollback
tags:
- rpm_ostree_rollback
- rhcos
# Before we reboot, check the journal for anything that blew up
- role: journal_fatal_msgs
tags:
- journal_fatal_msgs_second_reboot
- journal_fatal_msgs
- rhcos
# Reboot the host and don't continue until expected services have started
- role: reboot
wait_for_services:
- docker
tags:
- reboot_post_upgrade
- rhcos
# ---
- name: Improved Sanity Test - Post-Rollback
hosts: "{{ subjects | default('all') }}"
become: true
force_handlers: true
tags:
- atomic
- post_rollback
vars_files:
- "vars/common.yml"
- ["vars/{{ ansible_distribution|lower }}.yml", "vars/os_defaults.yml"]
roles:
- role: ansible_version_check
tags:
- ansible_version_check
- rhcos
# Set up handler notification
- role: handler_notify_on_failure
handler_name: h_get_journal
tags:
- handler_notify_on_failure
- rhcos
check_mode: false
# Ensure the host(s) are indeed Atomic Host(s)
- role: atomic_host_check
tags:
- atomic_host_check
- rhcos
# Before we do any additional actions, let's check the journal to see if
# anything blew up after reboot
- role: journal_fatal_msgs
tags:
- journal_fatal_msgs_third_boot
- journal_fatal_msgs
- rhcos
- role: selinux_verify
tags:
- selinux_verify
- rhcos
# TEST
# Verify that the change to the SELinux file context still exists in
# the original deployment
- role: semanage_fcontext_verify
test_dir: "{{ g_semanage_test_dir }}"
test_context: "{{ g_semanage_test_context }}"
tags:
- semanage_fcontext_verify
- rhcos
# TEST
# Check layered package is still installed
- role: rpm_ostree_install_verify
roiv_package_name: "{{ g_pkg }}"
roiv_binary_name: "{{ g_pkg }}"
tags:
- rpm_ostree_install_verify
# TEST
# Check second package is not installed
- role: rpm_ostree_uninstall_verify
rouv_package_name: "{{ g_ros_install_pkg }}"
rouv_binary_name: "{{ g_ros_install_bin }}"
tags:
- rpm_ostree_uninstall_verify
# TEST
# Check admin unlock overlayfs missing
- role: overlayfs_verify_missing
tags:
- overlayfs_verify_missing
# TEST
# Check that /tmp is properly setup yet again
- role: tmp_check_perms
tags:
- tmp_check_perms
- rhcos
# TEST
# Check that the RPM database is functional yet again
- role: rpmdb_verify
tags:
- rpmdb_verify
- rhcos