Add OpenBSD

This commit is contained in:
Anthony Rose 2023-08-21 20:26:45 -03:00
parent 68ddb5835f
commit 60134dba95
7 changed files with 163 additions and 0 deletions

View file

@ -58,6 +58,9 @@
- include_role:
name: netbsd
when: ansible_distribution == 'NetBSD'
- include_role:
name: openbsd
when: ansible_distribution == 'OpenBSD'
- include_role:
name: ubuntu
when: ansible_distribution == 'Ubuntu'

View file

@ -0,0 +1,23 @@
---
# Copyright 2021-2023 Anthony Perkins
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- import_tasks: packages-cli.yml
- import_tasks: packages-gui.yml
when: gui == true
- import_tasks: rc.yml
- import_tasks: ssh.yml
- import_tasks: qemu-guest.yml
when: gui == true and ansible_virtualization_role == "guest" and ansible_virtualization_type == "kvm"

View file

@ -0,0 +1,25 @@
---
# Copyright 2021-2023 Anthony Perkins
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Install core CLI packages
become: true
community.general.openbsd_pkg:
name: '{{ packages }}'
state: present
vars:
packages:
- ansible
- git
- mc

View file

@ -0,0 +1,28 @@
---
# Copyright 2021-2023 Anthony Perkins
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Install core GUI packages
become: true
community.general.openbsd_pkg:
name: '{{ packages }}'
state: present
vars:
packages:
- firefox
- icewm
- keepassxc
- noto-fonts
- rxvt-unicode
- vim--no_x11

View file

@ -0,0 +1,22 @@
---
# Copyright 2021-2023 Anthony Perkins
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Set QEMU UEFI screen resolution
become: true
ansible.builtin.lineinfile:
path: /etc/boot.conf
regexp: '^machine gop .*'
line: 'machine gop 6'
create: yes

View file

@ -0,0 +1,28 @@
---
# Copyright 2021-2023 Anthony Perkins
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Enable XDM
become: true
ansible.builtin.lineinfile:
path: /etc/rc.conf.local
regexp: '^xenodm_flags=.*'
line: 'xenodm_flags='
create: yes
- name: Enable dbus
become: true
ansible.builtin.lineinfile:
path: /etc/rc.conf.local
regexp: '^messagebus_flags=.*'
line: 'messagebus_flags='

View file

@ -0,0 +1,34 @@
---
# Copyright 2021-2023 Anthony Perkins
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Disable SSH passwords
become: true
ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: '^#?\w*PasswordAuthentication (yes|no)'
line: 'PasswordAuthentication no'
register: changed_ssh_config
- name: Enable SSH
become: true
ansible.builtin.service:
name: sshd
enabled: yes
state: started
- name: Restart SSH
become: true
ansible.builtin.service:
name: sshd
state: restarted
when: changed_ssh_config.changed == true