Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ansiblebit/macports
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.9.10
Choose a base ref
...
head repository: ansiblebit/macports
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Oct 22, 2015

  1. fix changelog

    steenzout committed Oct 22, 2015

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a13ac49 View commit details

Commits on Sep 22, 2017

  1. Copy the full SHA
    0394568 View commit details
  2. Copy the full SHA
    2a1aa7a View commit details
  3. meta: make galaxy happy.

    steenzout committed Sep 22, 2017
    Copy the full SHA
    ebf4a83 View commit details

Commits on Jan 24, 2018

  1. Use import_tasks

    opoplawski committed Jan 24, 2018
    Copy the full SHA
    5032d2e View commit details

Commits on Jun 28, 2018

  1. vars/main.yml: removed.

    steenzout committed Jun 28, 2018
    Copy the full SHA
    ee602ea View commit details
  2. defaults/main.yml: updated.

    steenzout committed Jun 28, 2018
    Copy the full SHA
    3e0492c View commit details
  3. Merge pull request #5 from opoplawski/import_tasks

    Use import_tasks
    steenzout authored Jun 28, 2018
    Copy the full SHA
    f95b3fb View commit details
  4. Copy the full SHA
    d8bd8ce View commit details
  5. use become.

    steenzout committed Jun 28, 2018
    Copy the full SHA
    6d209cc View commit details
  6. Copy the full SHA
    15611ff View commit details
  7. README.md: clean.

    steenzout committed Jun 28, 2018
    Copy the full SHA
    9023416 View commit details
  8. Copy the full SHA
    9d66539 View commit details
  9. Copy the full SHA
    0e2f75f View commit details
  10. use galaxy_tags.

    steenzout committed Jun 28, 2018
    Copy the full SHA
    13390e6 View commit details

Commits on Nov 26, 2018

  1. Add 10.14 Mojave

    Update tarball url
    Update macports_version to 2.5.4
    opoplawski committed Nov 26, 2018
    Copy the full SHA
    e5ecf1c View commit details

Commits on Nov 27, 2018

  1. Use become instead of sudo

    opoplawski committed Nov 27, 2018
    Copy the full SHA
    7d1bbf9 View commit details

Commits on Nov 30, 2018

  1. Merge pull request #8 from opoplawski/become

    Use become instead of sudo
    steenzout authored Nov 30, 2018
    Copy the full SHA
    e4b0b0d View commit details
  2. Merge pull request #7 from opoplawski/mojave

    Add 10.14 Mojave
    steenzout authored Nov 30, 2018
    Copy the full SHA
    711427e View commit details

Commits on Jun 29, 2021

  1. Copy the full SHA
    e6bc14a View commit details

Commits on Jan 10, 2022

  1. Update for OSX 11.6

    ilvidel committed Jan 10, 2022
    Copy the full SHA
    20fffec View commit details
  2. fix errors

    ilvidel committed Jan 10, 2022
    Copy the full SHA
    96e0577 View commit details

Commits on Feb 17, 2022

  1. Merge pull request #10 from ilvidel/catalina-bigsur

    Support Catalina and BigSur, and make 2.7.1 the default
    steenzout authored Feb 17, 2022
    Copy the full SHA
    9029666 View commit details
Showing with 42 additions and 114 deletions.
  1. +1 −1 .travis.yml
  2. +11 −52 README.md
  3. +14 −11 defaults/main.yml
  4. +1 −31 meta/main.yml
  5. +1 −1 tasks/main.yml
  6. +3 −3 tasks/os_family/darwin.yml
  7. +5 −6 tasks/os_family/darwin_macosx.yml
  8. +2 −2 tasks/os_family/darwin_source.yml
  9. +4 −5 tox.ini
  10. +0 −2 vars/main.yml
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: python
python: 2.7
python: 3.6
os:
- osx
sudo: yes
63 changes: 11 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -12,74 +12,33 @@ An [Ansible](http://www.ansible.com) role for [macports](http://www.macports.org

| Family | Distribution | Version | Test Status |
|:-:|:-:|:-:|:-:|
| Darwin | MacOSX | 10.10 | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](#) |
| Darwin | MacOSX | 10.13 | [![x86_64](http://img.shields.io/badge/x86_64-passed-006400.svg?style=flat)](#) |


## Requirements

- ansible >= 1.7.2
- ansible >= 2.4


## Role Variables

### User defined variables
- **macports_version**: the macports version to be installed (default: `2.5.2`).
- **macports_upgrade_outdated**: flag to determine if outdated ports should be upgraded after the installation process (default: `yes`).
- **macports_selfupdate**: flag to determine if the latest port revisions should be downloaded (default: `yes`).

| variable | default value | description |
|:--------:|:-------------:|:------------|
| macports_version | 2.3.4 | the macports version to be installed. |
| macports_upgrade_outdated | yes | flag to determine if outdated ports should be upgraded after the installation process. |
| macports_selfupdate | yes | flag to determine if the latest port revisions should be downloaded. |


### Default variables

| variable | description |
|:--------:|:------------|
| macports_build_from_source | flag to determine if macports is to be installed from source (not supported yet). |
| macports_force_install | flag to indicate if a new install is to be performed even if macports is already present in the server. |
| macports_installer | hash that contains the filename and SHA256 checksum of the macports files for each supported OS family and distribution. |
| macports_tarball | the file name of the macports tarball. |
| macports_tarball_url | the prefix for the URL from which the macports tarball will be downloaded. |
- **macports_build_from_source**: flag to determine if macports is to be installed from source (not supported yet).
- **macports_force_install**: flag to indicate if a new install is to be performed even if macports is already present in the server.
- **macports_installer**: hash that contains the filename and SHA256 checksum of the macports files for each supported OS family and distribution.
- **macports_tarball**: the file name of the macports tarball.
- **macports_tarball_url**: the prefix for the URL from which the macports tarball will be downloaded.


## Dependencies

None.


## Playbooks

- hosts: servers
roles:
- { role: ansiblebit.macports,
macports_version: 2.3.4,
macports_selfupdate: yes,
macports_upgrade_outdated: yes }

## Changelog

- v1.9.10 : 21 Oct 2015
- changed download URL to sourceforge.net
- v1.9.8 : 5 Oct 2015
- merged with primogen v9
- v1.0.8 : 5 Oct 2015
- default `macports_version` changed to 2.3.4
- added support for OSX 10.11 El Capitan
- v1.0.6 : 5 Oct 2015
- added macports_selfupdate variable
- changed status when upgrading outdated ports is now set correctly
- v1.0.4 : 15 March 2015
- added OSX 10.10.2 as supported version
- v1.0.2 :
- fixed [issue #1 : playbook fails when there are no ports to upgrade](https://github.com/ansiblebit/macports/issues/1)
- v1.0.0 :
- initial release

## License

BSD

## Author Information

- [steenzout](http://github.com/steenzout)

- role: ansiblebit.macports
25 changes: 14 additions & 11 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -3,31 +3,34 @@
#
# defaults file

macports_version: 2.3.4
macports_tarball_url: "http://downloads.sourceforge.net/project/macports/MacPorts/{{ macports_version }}/"
macports_version: 2.7.1
macports_tarball_url: "https://distfiles.macports.org/MacPorts/"
macports_build_from_source: no
macports_selfupdate: yes
macports_upgrade_outdated: yes
macports_force_install: no

macports_installer:
macosx:
'11.6':
name: "MacPorts-{{ macports_version }}-11-BigSur.pkg"
'10.15':
name: "MacPorts-{{ macports_version }}-10.15-Catalina.pkg"
'10.14':
name: "MacPorts-{{ macports_version }}-10.14-Mojave.pkg"
'10.13':
name: "MacPorts-{{ macports_version }}-10.13-HighSierra.pkg"
'10.12':
name: "MacPorts-{{ macports_version }}-10.12-Sierra.pkg"
'10.11':
name: "MacPorts-{{ macports_version }}-10.11-ElCapitan.pkg"
sha256: 8c0b492032c796d766b76da3d1fda8dea732a6cc9056633a3509e3ff06b5e8d8
'10.10':
name: "MacPorts-{{ macports_version }}-10.10-Yosemite.pkg"
sha256: 7eb27ccbdf5cb61840494d954e8b56a9ee96c250d6c6c6ac887f0d80836d2d17
'10.9':
name: "MacPorts-{{ macports_version }}-10.9-Mavericks.pkg"
sha256: 30d35308cf3bf6b66e6ed489ae7d1012f6e465ec4b4349a5c26a959e9130b512
'10.8':
name: "MacPorts-{{ macports_version }}-10.8-MountainLion.pkg"
sha256: ef5ae9c9fbe1a84eb0b1a7b5bf7d4b6b0d763bb5739f84fce8b43e9e5c68d5a1
'10.7':
name: "MacPorts-{{ macports_version }}-10.8-Lion.pkg"
sha256: ef5ae9c9fbe1a84eb0b1a7b5bf7d4b6b0d763bb5739f84fce8b43e9e5c68d5a1
name: "MacPorts-{{ macports_version }}-10.7-Lion.pkg"
'10.6':
name: "MacPorts-{{ macports_version }}-10.8-SnowLeopard.pkg"
sha256: ef5ae9c9fbe1a84eb0b1a7b5bf7d4b6b0d763bb5739f84fce8b43e9e5c68d5a1

name: "MacPorts-{{ macports_version }}-10.6-SnowLeopard.pkg"
32 changes: 1 addition & 31 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -11,37 +11,7 @@ galaxy_info:
min_ansible_version: 1.7.2
platforms:
- name: MacOSX
versions:
- 10.11.1
- 10.10.5
- 10.10.4
- 10.10.3
- 10.10.2
- 10.10.1
- 10.9.5
- 10.9.4
- 10.9.3
- 10.9.2
- 10.9.1
- 10.8.5
- 10.8.4
- 10.8.3
- 10.8.2
- 10.8.1
- 10.7.5
- 10.7.4
- 10.7.3
- 10.7.2
- 10.7.1
- 10.6.8
- 10.6.7
- 10.6.6
- 10.6.5
- 10.6.4
- 10.6.3
- 10.6.2
- 10.6.1
categories:
galaxy_tags:
- packaging
dependencies: []

2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
## include OS family specific task file

- name: if darwin, include family specific task file
include: os_family/darwin.yml
import_tasks: os_family/darwin.yml
when: ansible_os_family | lower == 'darwin'

- name: check if operating system is suported
6 changes: 3 additions & 3 deletions tasks/os_family/darwin.yml
Original file line number Diff line number Diff line change
@@ -6,11 +6,11 @@
os_supported: yes

- name: include build from source task file
include: darwin_source.yml
import_tasks: darwin_source.yml
when: macports_build_from_source or not ansible_distribution | lower == 'macosx'

- name: include macosx distribution task file
include: darwin_macosx.yml
import_tasks: darwin_macosx.yml
vars:
major_version: "{{ ansible_distribution_version.split('.')[0:2] | join('.') }}"
when: not macports_build_from_source and ansible_distribution | lower == 'macosx'
when: not macports_build_from_source and ansible_distribution | lower == 'macosx'
11 changes: 5 additions & 6 deletions tasks/os_family/darwin_macosx.yml
Original file line number Diff line number Diff line change
@@ -15,36 +15,35 @@
get_url:
url="{{ macports_tarball_url }}/{{ macports_installer[ 'macosx' ][ major_version ][ 'name' ] }}"
dest=/tmp
sha256sum={{ macports_installer[ 'macosx' ][ major_version ][ 'sha256' ] }}
owner=root
group=wheel
mode=0644
sudo: yes
become: yes
when: not port.stat.exists or macports_force_install

- name: darwin | macosx | install macports
command: "installer -verbose -pkg {{ macports_installer[ 'macosx' ][ major_version ][ 'name' ] }} -target /"
args:
chdir: /tmp/
sudo: yes
become: yes
when: not port.stat.exists or macports_force_install

- name: darwin | macosx | update ports tree and rebuild installation if needed
command: port -v selfupdate
when: macports_selfupdate
sudo: yes
become: yes

- name: darwin | macosx | remove macports package installer
file:
path="/tmp/{{ macports_installer[ 'macosx' ][ major_version ][ 'name' ] }}"
state=absent
sudo: yes
become: yes

- name: darwin | macosx | upgrade outdated ports
command: port -v upgrade outdated
register: port_upgrade_outdated
changed_when: port_upgrade_outdated.rc != 0 and not 'Nothing to upgrade.' in port_upgrade_outdated.stdout
failed_when: port_upgrade_outdated.rc != 0 and 'Error' in port_upgrade_outdated.stdout
when: macports_upgrade_outdated
sudo: yes
become: yes

4 changes: 2 additions & 2 deletions tasks/os_family/darwin_source.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
group=staff
mode=0755
state=directory
sudo: yes
become: yes

- name: darwin | source | check if tarball exists
stat:
@@ -23,6 +23,6 @@
owner=root
group=wheel
mode=0644
sudo: yes
become: yes
when: not f.stat.exists

9 changes: 4 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
[tox]
envlist =
{py27}-{ansible193,ansible184,ansible172}
py{36}-ansible{24,25}

skipsdist = True


[testenv]
changedir = tests
deps =
travis: ansible==1.9.3
ansible193: ansible==1.9.3
ansible184: ansible==1.8.4
ansible172: ansible==1.7.2
ansible25: ansible>=2.5,<2.6
ansible24: ansible>=2.4,<2.5
travis: ansible25

passenv = ANSIBLE_ASK_SUDO_PASS HOME

2 changes: 0 additions & 2 deletions vars/main.yml

This file was deleted.