bundle agent sshd { files: any:: "/root/.ssh/." create => "true", perms => system_owned("700"), classes => if_repaired("sshd_ssh_dir_repaired"); "/root/.ssh/authorized_keys" create => "true", edit_defaults => empty, perms => system_owned("444"), edit_template => "$(sys.inputdir)/templates/sshd/authorized_keys", classes => if_repaired("sshd_authorized_keys_files_repaired"); classes: freebsd:: "sshd_service_running" expression => returnszero("/usr/sbin/service sshd status", "noshell"); methods: freebsd:: "freebsd" usebundle => add_rc_conf_line("$(this.bundle)", "sshd_enable=\"YES\""); commands: freebsd.!sshd_service_running:: "/usr/sbin/service sshd start" classes => if_repaired("sshd_service_repaired"); services: linux:: "sshd" service_policy => "start", classes => if_repaired("sshd_service_repaired"); reports: any:: "$(this.bundle): /root/.ssh directory repaired" ifvarclass => "sshd_ssh_dir_repaired"; "$(this.bundle): /root/.ssh/authorized_keys repaired" ifvarclass => "sshd_authorized_keys_files_repaired"; "$(this.bundle): sshd service repaired" ifvarclass => "sshd_service_repaired"; }