mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-08 21:34:25 +00:00
Expanded Ansible notions
This commit is contained in:
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -15,6 +15,7 @@
|
||||
"duperemove",
|
||||
"fdupes",
|
||||
"flatpak",
|
||||
"getfacl",
|
||||
"gpgtools",
|
||||
"growpart",
|
||||
"hadolint",
|
||||
@@ -33,6 +34,7 @@
|
||||
"nvme",
|
||||
"ocsp",
|
||||
"pacman",
|
||||
"pamac",
|
||||
"pkexec",
|
||||
"polkit",
|
||||
"pvresize",
|
||||
@@ -41,6 +43,8 @@
|
||||
"rootlv",
|
||||
"rootvg",
|
||||
"runcmd",
|
||||
"setfacl",
|
||||
"sshpass",
|
||||
"subvolume",
|
||||
"tclsh",
|
||||
"templating",
|
||||
|
||||
32
ansible/darwin.upgrade.system.yml
Normal file
32
ansible/darwin.upgrade.system.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
|
||||
- name: Upgrade a Darwin system
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
vars:
|
||||
homebrew_installed: false
|
||||
macports_installed: false
|
||||
mas_installed: false
|
||||
tasks:
|
||||
- name: Install system ugrades
|
||||
ansible.builtin.command: softwareupdate --install --recommended
|
||||
register: softwareupdate_result
|
||||
changed_when:
|
||||
- softwareupdate_result.stderr != 'No updates are available.'
|
||||
- name: Update homebrew and upgrade all packages
|
||||
when: homebrew_installed
|
||||
community.general.homebrew:
|
||||
update_homebrew: true
|
||||
upgrade_all: true
|
||||
- name: Update Macports and the ports tree, then upgrade all outdated ports
|
||||
when: macports_installed
|
||||
become: true
|
||||
community.general.macports:
|
||||
selfupdate: true
|
||||
upgrade: true
|
||||
register: macports_result
|
||||
changed_when: macports_result.stdout is not regex('Nothing to upgrade.')
|
||||
- name: Upgrade all installed Mac App Store apps
|
||||
when: mas_installed
|
||||
community.general.mas:
|
||||
upgrade_all: true
|
||||
1021
examples/ansible/setup.output.json
Normal file
1021
examples/ansible/setup.output.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -32,9 +32,13 @@
|
||||
pip3 install --user 'ansible' && port install 'sshpass' # darwin
|
||||
sudo pamac install 'ansible' 'sshpass' # manjaro linux
|
||||
|
||||
# Generate an example configuration file with all entries disabled.
|
||||
ansible-config init --disabled > 'ansible.cfg'
|
||||
ansible-config init --disabled -t 'all' > 'ansible.cfg'
|
||||
|
||||
# Show hosts' ansible facts.
|
||||
ansible -i 'path/to/hosts/file' -m 'setup' all
|
||||
ansible -i 'host1,hostn,' -m 'setup' 'host1' -u 'remote-user'
|
||||
ansible -i 'host1,hostN,' -m 'setup' 'host1' -u 'remote-user'
|
||||
ansible -i 'localhost,' -c 'local' -km 'setup' 'localhost'
|
||||
|
||||
# Check the syntax of a playbook.
|
||||
@@ -43,7 +47,7 @@ ansible-playbook 'path/to/playbook.yml' --syntax-check
|
||||
|
||||
# Execute a playbook.
|
||||
ansible-playbook 'path/to/playbook.yml' -i 'hosts.list'
|
||||
ansible-playbook … -i 'host1,host2,hostn,' -l 'hosts,list'
|
||||
ansible-playbook … -i 'host1,host2,hostN,' -l 'hosts,list'
|
||||
ansible-playbook … -i 'host1,host2,other,' -l 'hosts-pattern'
|
||||
|
||||
# Show what changes (with details) a play would apply to the local machine.
|
||||
@@ -84,7 +88,7 @@ Ansible will process the following list and use the first file found; all the ot
|
||||
|
||||
1. the `ANSIBLE_CONFIG` environment variable;
|
||||
1. the `ansible.cfg` file in the current directory;
|
||||
1. the `~/.ansible.cfg` file in the home directory;
|
||||
1. the `~/.ansible.cfg` file in the user's home directory;
|
||||
1. the `/etc/ansible/ansible.cfg` file.
|
||||
|
||||
One can generate a fully commented-out example of the `ansible.cfg` file:
|
||||
|
||||
Reference in New Issue
Block a user