Migrate shell to FQCN.
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
- name: General | Account Management | Users | Root
|
||||
ansible.builtin.user:
|
||||
name: root
|
||||
shell: "{{ bash_exec.stdout }}"
|
||||
ansible.builtin.shell: "{{ bash_exec.stdout }}"
|
||||
create_home: true
|
||||
generate_ssh_key: true
|
||||
register: user_root
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
mode: '0755'
|
||||
|
||||
- name: General | Scripts | Install | Remove Old Scripts
|
||||
shell: |
|
||||
ansible.builtin.shell: |
|
||||
if [[ -e {{ global_bin }}/{{ item }} ]]; then
|
||||
rm -v {{ global_bin }}/{{ item }}
|
||||
fi
|
||||
|
||||
@@ -43,10 +43,10 @@
|
||||
dest: "{{ aur_helper_dir }}"
|
||||
|
||||
- name: General | Software | AUR | Install | Change Permissions
|
||||
shell: "chown -Rc {{ aur_user }}:wheel {{ aur_helper_dir }}"
|
||||
ansible.builtin.shell: "chown -Rc {{ aur_user }}:wheel {{ aur_helper_dir }}"
|
||||
|
||||
- name: General | Software | AUR | Install | Build & Integrate
|
||||
shell: "cd {{ aur_helper_dir }} && makepkg -si --noconfirm"
|
||||
ansible.builtin.shell: "cd {{ aur_helper_dir }} && makepkg -si --noconfirm"
|
||||
become: true
|
||||
become_user: "{{ aur_user }}"
|
||||
changed_when: true
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
register: metasploit_status
|
||||
|
||||
- name: General | Software | Metasploit | Refresh Apt Files
|
||||
shell: "{{ item }}"
|
||||
ansible.builtin.shell: "{{ item }}"
|
||||
loop:
|
||||
- "mkdir -p /tmp/apt/"
|
||||
- "mv -fv /usr/share/keyrings/metasploit-framework.gpg /tmp/apt/metasploit-framework.gpg.old"
|
||||
@@ -25,7 +25,7 @@
|
||||
ignore_errors: true
|
||||
|
||||
- name: General | Software | Metasploit | Install
|
||||
shell: "{{ item }}"
|
||||
ansible.builtin.shell: "{{ item }}"
|
||||
loop:
|
||||
- "curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > {{ metasploit_installer }}"
|
||||
- "chmod 755 {{ metasploit_installer }}"
|
||||
@@ -37,7 +37,7 @@
|
||||
and pentesting
|
||||
|
||||
- name: General | Software | Metasploit | Remove (Darwin)
|
||||
shell: "{{ item }}"
|
||||
ansible.builtin.shell: "{{ item }}"
|
||||
loop:
|
||||
- "/opt/metasploit-framework/bin/msfremove"
|
||||
when: ansible_system in ("Darwin")
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
nix_exe: ~/.deleteme.nix.sh
|
||||
|
||||
- name: Install Nix
|
||||
shell: "{{ item }}"
|
||||
ansible.builtin.shell: "{{ item }}"
|
||||
loop:
|
||||
- "curl -L https://nixos.org/nix/install > {{ nix_exe }}"
|
||||
- "chmod 755 {{ nix_exe }}"
|
||||
@@ -27,7 +27,7 @@
|
||||
become_user: "{{ user }}"
|
||||
|
||||
- name: Install Nix Software
|
||||
shell: "{{ item }}"
|
||||
ansible.builtin.shell: "{{ item }}"
|
||||
loop:
|
||||
- "nix-env -iA nixpkgs.lbry" # Installs, but doesnt launch?
|
||||
#$ lbry
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
when: swap_block != false
|
||||
|
||||
- name: General | Software | NixOS | Update Config Project
|
||||
shell: "files/scripts/nixos.sh -b {{ branch }}"
|
||||
ansible.builtin.shell: "files/scripts/nixos.sh -b {{ branch }}"
|
||||
|
||||
- name: General | Software | NixOS | Create Ansible Nix Config
|
||||
blockinfile:
|
||||
@@ -36,7 +36,7 @@
|
||||
# Maybe do home manager here? Or should it be under Workstation? Or maybe
|
||||
# this is the spot where I start creating workstation.nix, server.nix, etc.
|
||||
#- name: General | Software | NixOS | Home Manager? *.nix file management?
|
||||
# shell:
|
||||
# ansible.builtin.shell:
|
||||
# loop:
|
||||
# - ???
|
||||
# - ???
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# They have zypper higher in the path, but it's really apt renamed.
|
||||
# Probably for "security", but package module does not use the ansible_pkg_mgr variable
|
||||
# so resetting the value to apt doesn't work. Just going to move it.
|
||||
shell: "mv `which zypper` `which zypper`.zz.`date +%Y%m%d`"
|
||||
ansible.builtin.shell: "mv `which zypper` `which zypper`.zz.`date +%Y%m%d`"
|
||||
register: parrotos_zypper_removed
|
||||
ignore_errors: true
|
||||
when: ansible_distribution == "Parrot OS"
|
||||
@@ -16,13 +16,13 @@
|
||||
when: ansible_distribution == "Parrot OS" and parrotos_zypper_removed is defined and not parrotos_zypper_removed.failed
|
||||
|
||||
- name: General | Software | Packages | Fix Parrot OS (zypper), Exiting
|
||||
shell: exit 1
|
||||
ansible.builtin.shell: exit 1
|
||||
when: ansible_distribution == "Parrot OS" and parrotos_zypper_removed is defined and not parrotos_zypper_removed.failed
|
||||
|
||||
# More Parrot OS junk. They have a command called update in /usr/bin. Doesn't
|
||||
# have sudo or anything in it. Hide it in preference for .bashrc update function.
|
||||
- name: General | Software | Packages | Fix Parrot OS 2 (update)
|
||||
shell: "mv `which update` `which update`.zz.`date +%Y%m%d`"
|
||||
ansible.builtin.shell: "mv `which update` `which update`.zz.`date +%Y%m%d`"
|
||||
ignore_errors: true
|
||||
when: ansible_distribution == "Parrot OS"
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
when: ansible_pkg_mgr in ["apt", "pacman"]
|
||||
|
||||
- name: General | Software | Packages | Cache Refresh (FreeBSD)
|
||||
shell: pkg update
|
||||
ansible.builtin.shell: pkg update
|
||||
when: ansible_system == "FreeBSD"
|
||||
|
||||
- name: General | Software | Packages | Install Software
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
sendmail_queue: sendmail_msp_queue
|
||||
|
||||
- name: Server | Sendmail | Check
|
||||
shell: which postfix
|
||||
ansible.builtin.shell: which postfix
|
||||
register: postfix
|
||||
ignore_errors: true
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
## JournalCTL ##
|
||||
|
||||
- name: General | Software | Services | JournalCTL | Reduce Log Size
|
||||
shell: journalctl --vacuum-size=100M
|
||||
ansible.builtin.shell: journalctl --vacuum-size=100M
|
||||
when: ansible_system == "Linux"
|
||||
and ansible_service_mgr == "systemd"
|
||||
ignore_errors: true
|
||||
@@ -135,7 +135,7 @@
|
||||
when: ansible_service_mgr != "runit"
|
||||
|
||||
- name: General | Software | Services | Disable (runit)
|
||||
shell: |
|
||||
ansible.builtin.shell: |
|
||||
if [[ -e {{ runit_service_dir }}/{{ item.name }} ]]; then
|
||||
rm -v {{ runit_service_dir }}/{{ item.name }}
|
||||
fi
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
block:
|
||||
|
||||
- name: General | Software | Swap | Create Swapfile
|
||||
shell: "{{ item }}"
|
||||
ansible.builtin.shell: "{{ item }}"
|
||||
loop:
|
||||
- dd if=/dev/zero of={{ swap_file }} bs={{ swap_block }}
|
||||
count={{ swap_count }} status=progress
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#### Install #
|
||||
###
|
||||
###- name: General | Telegraf | Linux | Install
|
||||
### shell: "{{ item }}"
|
||||
### ansible.builtin.shell: "{{ item }}"
|
||||
### args:
|
||||
### chdir: "{{ ansible_env.HOME }}/Downloads/"
|
||||
### loop:
|
||||
@@ -61,7 +61,7 @@
|
||||
### when: ansible_system == "Linux"
|
||||
###
|
||||
###- name: General | Telegraf | FreeBSD | Install 1/2
|
||||
### shell: /usr/sbin/pwd_mkdb -p /etc/master.passwd
|
||||
### ansible.builtin.shell: /usr/sbin/pwd_mkdb -p /etc/master.passwd
|
||||
### when: ansible_system == "FreeBSD"
|
||||
###
|
||||
###- name: General | Telegraf | FreeBSD | Install 2/2
|
||||
@@ -72,7 +72,7 @@
|
||||
#### Configuration #
|
||||
###
|
||||
###- name: General | Telegraf | Config 1/2
|
||||
### shell: mv {{ telegraf_config }} ~/TRASH/
|
||||
### ansible.builtin.shell: mv {{ telegraf_config }} ~/TRASH/
|
||||
### ignore_errors: true
|
||||
###
|
||||
###- name: General | Telegraf | Config 2/2
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Ensure an existing run is not active, otherwise bail.
|
||||
|
||||
- name: General | Tests | Existing Run | Lock | Create
|
||||
shell: "date +'%Y-%m-%d %H:%M:%S' >> {{lock_file }}"
|
||||
ansible.builtin.shell: "date +'%Y-%m-%d %H:%M:%S' >> {{lock_file }}"
|
||||
|
||||
|
||||
- name: General | Tests | Existing Run | Lock | Create
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
recurse: false
|
||||
|
||||
- name: General | Tests | Lynis | Run System Audit
|
||||
shell: "{{ item }}"
|
||||
ansible.builtin.shell: "{{ item }}"
|
||||
loop:
|
||||
- "./lynis audit system --no-colors > {{ lynis_temp_file }} 2>&1"
|
||||
- "mv {{ lynis_temp_file }} {{ lynis_file }}"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
nmap_temp_file: "{{ nmap_file }}.tmp"
|
||||
|
||||
- name: General | Tests | nmap | Create Report
|
||||
shell: "{{ item }}"
|
||||
ansible.builtin.shell: "{{ item }}"
|
||||
loop:
|
||||
- "date > {{ nmap_temp_file }}"
|
||||
- "printf '{{ nmap_separator }}' >> {{ nmap_temp_file }}"
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
when: ansible_service_mgr == "runit"
|
||||
|
||||
- name: General | Tests | Services | Create Main Report
|
||||
shell: "{{ item }}"
|
||||
ansible.builtin.shell: "{{ item }}"
|
||||
loop:
|
||||
- "date > {{ services_report_file }}"
|
||||
- "echo '\n-= {{ services_command }} =-\n' >> {{ services_report_file }}"
|
||||
- "{{ services_command }} >> {{ services_report_file }}"
|
||||
|
||||
- name: General | Tests | Services | Create Enabled Report
|
||||
shell: "{{ item }}"
|
||||
ansible.builtin.shell: "{{ item }}"
|
||||
loop:
|
||||
- "date > {{ services_enabled_file }}"
|
||||
- "echo '\n-= Enabled + Sorted =-\n' >> {{ services_enabled_file }}"
|
||||
|
||||
Reference in New Issue
Block a user