From e3b5d6b9159601df83798cafd5649eeba64e4102 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 1 Feb 2021 06:52:28 -0600 Subject: [PATCH] Add pkg refresh for FreeBSD. Create SSH key with shell instead of fancy module. Still looking into how to (safely) get newer ansible on Debian. --- local.yml | 4 ++-- tasks/general/acct_mgmt/keys.yml | 8 ++++++-- tasks/general/software/packages.yml | 6 +++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/local.yml b/local.yml index f837b7e..e73c830 100644 --- a/local.yml +++ b/local.yml @@ -20,8 +20,8 @@ - include: tasks/general/acct_mgmt/groups.yml - include: tasks/general/acct_mgmt/users.yml - include: tasks/general/acct_mgmt/sudo.yml - #- include: tasks/general/acct_mgmt/keys.yml - # when: ansible_distribution != "Debian" + - include: tasks/general/acct_mgmt/keys.yml + when: ansible_distribution != "Debian" - include: tasks/general/acct_mgmt/mounts.yml - include: tasks/general/cron/ansible.yml diff --git a/tasks/general/acct_mgmt/keys.yml b/tasks/general/acct_mgmt/keys.yml index 1aca209..c147ef8 100644 --- a/tasks/general/acct_mgmt/keys.yml +++ b/tasks/general/acct_mgmt/keys.yml @@ -1,9 +1,13 @@ --- # SSH keys for day-to-day system usage. +# Debian's ansible is too old to use this. +#- name: Create Root's SSH Key +# openssh_keypair: +# path: /root/.ssh/id_rsa + - name: Create Root's SSH Key - openssh_keypair: - path: /root/.ssh/id_rsa + shell: ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa <<< n - name: Join System to 1337 Share shell: ssh-copy-id -f -i /root/.ssh/id_rsa ling@leet \ No newline at end of file diff --git a/tasks/general/software/packages.yml b/tasks/general/software/packages.yml index 1d78e58..5fdce31 100644 --- a/tasks/general/software/packages.yml +++ b/tasks/general/software/packages.yml @@ -1,11 +1,15 @@ --- # Cross-platform package management. -- name: Repo Cache Refresh +- name: Repo Cache Refresh (Apt and Pacman) package: update_cache: yes when: ansible_pkg_mgr in ["apt", "pacman"] +- name: Repo Cache Refresh (FreeBSD) + shell: pkg update + when: ansible_system == "FreeBSD" + - name: Repo Install Software package: name: