Debug
To display some facts (12-18) and values of the control variables (36-80), select the task fp_debug and enable the debug output. By default, all control variables are disabled. Below is an example configuration of a typical VM for testing
1shell> ansible-playbook playbook.yml -t fp_debug -e fp_debug=true
2
3PLAY [test_14.example.com] *******************************************************************
4
5TASK [Gathering Facts] ***********************************************************************
6ok: [test_14.example.com]
7
8TASK [vbotka.freebsd_postinstall : FreeBSD postinstall Debug] ********************************
9ok: [test_14.example.com] =>
10 msg: |-
11 fp_role_version: 2.6.12
12 ansible_architecture: amd64
13 ansible_os_family: FreeBSD
14 ansible_distribution: FreeBSD
15 ansible_distribution_major_version: 14
16 ansible_distribution_version: 14.1
17 ansible_distribution_release: 14.1-RELEASE
18 ansible_python_version: 3.9.18
19
20 rc_conf_hostname: test_14.example.com
21 fp_domain: example.com
22 aws: False
23 digitalocean: False
24 gcp: False
25
26 freebsd_install_method: packages
27 freebsd_use_packages: True
28 freebsd_install_retries: 3
29 freebsd_install_delay: 5
30
31 fp_install: True
32 fp_backup: True
33 fp_vars: False fp_vars_default_versions: False
34 fp_sanity: True fp_sanity_tags_fatal: True
35
36 fp_aliases: True
37 fp_apcupsd: True fp_apcupsd_install: True fp_apcupsd_enabled: False
38 fp_authorized_key: True
39 fp_copy: True fp_unarch_default: False fp_unarch_optional: False
40 fp_cron: True
41 fp_devfs: False fp_devfs_enabled: False
42 fp_dhclient: False
43 fp_freebsd_update: False
44 fp_fstab: True
45 fp_gitserver: False fp_gitserver_install: False
46 fp_groups: True
47 fp_groupwrappers: True fp_groupwrappers_install: True
48 fp_hostapd: False fp_hostapd_install: False fp_hostapd_enabled: False
49 fp_hostname: True
50 fp_hosts: True
51 fp_inetd: False fp_inetd_enabled: False
52 fp_libmap: False
53 fp_linux: True fp_linux_install: False fp_linux_enable: True
54 fp_loader: True fp_loader_load_modules: False
55 fp_login: True fp_login_conf_global: True
56 fp_make: True
57 fp_motd: True
58 fp_mount_img: False
59 fp_mount_iso: True
60 fp_nfs: True fp_nfs_enable: True
61 fp_nfsd: True fp_nfsd_enable: False
62 fp_ntp: True fp_ntp_enable: True
63 fp_ntpdate: True fp_ntpdate_enable: False
64 fp_passwords: True
65 fp_periodic: True
66 fp_procmail: True fp_procmail_install: True
67 fp_qemu: False fp_qemu_enabled: False fp_qemu_install: False fp_qemu_user_static_install: False
68 fp_resolvconf: False
69 fp_smartd: True fp_smartd_install: True fp_smartd_enabled: True
70 fp_snmpd: False fp_snmpd_install: False fp_snmpd_enabled: False
71 fp_ssh: True
72 fp_sshd: True fp_sshd_enable: True
73 fp_sudoers: True
74 fp_swap: True fp_swap_enable: True
75 fp_sysctl: True
76 fp_syslogd: False fp_syslogd_enabled: False
77 fp_timezone: True
78 fp_tmpmfs: False
79 fp_users: True
80 fp_wpasuppliant: True fp_wpasuppliant_install: True
81
82 fp_mountd_enable: True
83 fp_rpcbind_enable: True
84 fp_rpc_lockd_enable: True
85 fp_rpc_statd_enable: True
86 ...
87
88PLAY RECAP ***********************************************************************************
89test_14.example.com: ok=3 changed=0 unreachable=0 failed=0 skipped=7 rescued=0 ignored=0
Note
If you use the configuration from the Quick start guide enable ok hosts either by the
environment variable ANSIBLE_DISPLAY_OK_HOSTS=True
or in the configuration file
display_ok_hosts=true
.
Some tasks will display additional information when the variable
fp_*_debug is enabled. For example, see the configuration of
sshd below. Inspect the files in the tasks
directory whether
debug is available or not
1shell> ansible-playbook playbook.yml -t fp_sshd_debug -e fp_sshd_debug=true
2
3PLAY [test_14.example.com] *******************************************************************
4
5TASK [Gathering Facts] ***********************************************************************
6ok: [test_14.example.com]
7
8TASK [vbotka.freebsd_postinstall : sshd: Debug (fp_sshd_debug=true)] *************************
9ok: [test_14.example.com] =>
10 msg: |-
11 fp_sshd_bin: /usr/sbin/sshd
12 fp_sshd_conf_file: /etc/ssh/sshd_config
13 fp_sshd_conf:
14 - {key: PasswordAuthentication, value: 'no'}
15 - {key: ChallengeResponseAuthentication, value: 'no'}
16 - {key: PermitRootLogin, value: 'no'}
17 - {key: PermitTunnel, value: 'no'}
18 - {key: AllowTcpForwarding, value: 'yes'}
19 - {key: X11Forwarding, value: 'no'}
20 - {key: UseBlacklist, value: 'yes'}
21
22PLAY RECAP ***********************************************************************************
23test_14.example.com: ok=2 changed=0 unreachable=0 failed=0 skipped=3 rescued=0 ignored=0
Note
The debug output of this role is optimized for the yaml callback plugin. Set the plugin in the environment
shell> export ANSIBLE_STDOUT_CALLBACK=yaml
or in the configuration file
stdout_callback = yaml
See the details about the yaml callback plugin
shell> ansible-doc -t callback community.general.yaml
See the list of other callback plugins
shell> ansible-doc -t callback -l