--- - name: "Playbook for my various machines" hosts: localhost connection: local force_handlers: true vars: log_path: "{{ ansible_user_dir }}/.local/state/post_install/{{ ansible_date_time.iso8601_basic_short }}.log" pre_tasks: - name: "Create Logfile" block: - name: "Create Folder" ansible.builtin.file: path: "{{ ansible_user_dir }}/.local/state/post_install" state: directory mode: '0700' - name: "Create File" ansible.builtin.file: path: "{{ log_path }}" state: touch mode: '0700' roles: - name: fedora when: - ansible_distribution == 'Fedora' - ansible_pkg_mgr == 'dnf5' - name: silverblue when: - ansible_distribution == 'Fedora' - ansible_pkg_mgr == 'atomic_container' - name: gnome when: ansible_env.DESKTOP_SESSION == 'gnome' - name: dotfiles